PlatformIO rather slow on a raspberry pi

PlatformIO is an amazing tool, and obviously there’s no performance issues when I run it on my Macbook pro.

But I also use it on a raspberry pi, and it probably takes about thirty seconds before it even starts doing any work. Eg:

$ time pio -h
real	0m29.268s
user	0m28.895s
sys	0m0.340s

Even just importing the platformio module takes 20 seconds

$ time python3 -c "from platformio.__main__ import main"
real	0m18.208s
user	0m17.991s
sys	0m0.211s

I certainly appreciate that the raspberry pi is a slow device, but I can’t help thinking that this is an awfully long time for a tool to start up and show its help output.

What model RasPi are you using? I just ran “time pio -h” on my Raspberry Pi 5 with a USB SSD and it executed in half a second, though that’s close to the fastest Raspberry Pi setup.

Out of curiosity, I installed platformio on a Raspberry Pi 1.2b+ on a microsd running 32bit bookworm. As expected, it was a lot slower to do platformio -h than the RasPi 5, but still only about half the time that you were seeing:

real	0m16.414s
user	0m14.355s
sys	0m1.337s

Honestly, I’m kind of impressed that it still runs at all on a single core with 512MB of memory from a decade ago…

It’s a “Compute Module 3+” on a BalenaFin carrier board with 1G of RAM.

Clearly something is wrong with either the device, or my install. I did have to build python locally to get platformio to install, because the OS version was too old to get the required version from the apt repos.

Python itself is fast though, maybe my storage is slow

$ sudo hdparm -Tt /dev/mmcblk0p2

/dev/mmcblk0p2:
 Timing cached reads:   1296 MB in  2.00 seconds = 648.10 MB/sec
 Timing buffered disk reads:  66 MB in  3.05 seconds =  21.66 MB/sec