Local VS Cloud Compile speed

I noticed that even though compiling via Spark :cloud: requires the file to be uploaded --> compiled —> downloaded but it usually takes less than 15 seconds!

However, compiling locally on my Mac takes a while (relatively slower than pushing via Spark-CLI :stuck_out_tongue:)

Is there some setting i’m missing or there’s some magic going on for the cloud compiler?! :smiley:

i’ve always thought the cloud is incredibly slow - especially at flashing.

what spec machine are you using? it could be because you’re using a mac and an old dfu-util.

on my pretty low spec linux laptop it takes 29secs to compile the entire firmware (from a “make clean”) and flash via dfu - that’s 17secs to compile locally and 12secs to flash via dfu-util 0.8.

if i change the program, then it recompiles in under a second, and that’s using libraries too. i guess ccache helps a bit there too - it makes a massive difference when building android.

if you think the cloud is faster then i suspect the cloud already has the firmware compiled and cached and just rebuilds your “sketch”, in which case it should take under 13secs to build and flash.

i don’t think my higher spec desktop does the flashing any faster than the laptop, but obviously more ram/cpu/ssd helps with compiling.

Ignore the speed of the first build. Are subsequent builds also slow?

They are on Windows, mostly because the gcc port runs much slower there. I used to use the remote build feature of Netbeans to compile to a linux VM running on the same machine, but recently my 8GB of extra ram has failed, so I’m back to compiling locally. (A new 8GB is in the post!)

One option maybe to use precompiled headers - this usually significantly speeds up the build. (I used to do C++ 15 years ago on a Intel 486 and that compiled faster than the current codebase, mostly due to precompiled headers.)

2 Likes

compiling in a vm usually sucks too - unless you have a dedicated disk. i remember building xbmc for the xbox in a vm would take hours because its basically writing over the network to a file (even though its on the same machine).

as @mdma said better than i did, only rebuild speed matters, ignore the first one as it has to build everything not just your sketch

1 Like

Ah i should try to compile again… But still, i’m impressed by the compiling speed of a remote cloud :wink:

The reason the cloud is fast is because it’s rebuilding only what has changed, which is usually just your application files.

If you were to change a often used header file on the git repo the cloud compiles against, I’m sure you’d see a hit in the first build, but after that it goes fast. Also I imagine the cloud is running on a linux box, where gcc runs fastest.

Yeah,
We always say: what Intel gives, Bill takes away!
That said, I believe for serious programmers a local setup is a must. On my windows laptop, not the latest and the greatest, a 100kb + app takes 4 seconds during small changes, and 40 seconds for a complete recompile.

Gates stepped down as CEO in 2000, so let’s hope Moore’s law has given us time to catch up!