< Return to Blog

Rust for Embedded is Better on x86

Having recently picked up a M1 Max MacBook Pro, in hindsight I expected to run into some issues due to the change in CPU architecture.
For some the idea of 64GB RAM is excessive, but if you've been pushing Mac's to their limit as long as I have - I've been running 32GB RAM defacto for over a decade.  It doesn't take many tabs in Chrome to exhaust 16GB RAM.
Here's a snap of running some heavy IO in Docker:
Running both Glances and Htop
My particular use-case in this example was compiling a Rust toolchain with a custom LLVM from Espressif for the Tensilica Xtensa (ESP32) MCUs.  I was able to get quite far by running a Docker container, but remember the underlying architecture is still an ARM process in my MacBook Pro.
However, I soon ran into a known Docker issue where high IO with shared volumes start to slow down the more and more you push it.  It's possible I started to exhaust the cursor that tracks open files (ulimit) in the system.
Another odd thing I noticed is building esp-rs/rust-build would take almost 20 minutes to compile; something was definitely off.
As a compromise, I've moved this particular workload on to my Dell R740xd VM host.  It's unlikely I'll be saying bye to x86 anytime soon, at least for my embedded Rust needs!
Stats of a single VM.
Host stats, just 100GB of RAM left.