Compile time so slow

Post here all questions related to STM32 core if you can't find a relevant section!
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Compile time so slow

Post by fpiSTM »

It seems there is a bug in the Arduino IDE:
https://github.com/arduino-libraries/Ar ... -578033856
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: Compile time so slow

Post by fredbox »

I saw this come across the RSS feed a short while ago:

We’re excited to announce that Arduino IDE 1.8.11 is here!

In addition to the usual load of bugfixes and small improvements under the hood, the latest version includes:

Improved support for Mac OS X (the app is now notarized and strictly follows the latest OS X recommended security guidelines)
A “send text” command within the serial plotter (so you can interact with the board while plotting data!)
Better sketch build time
Updated AVR core and WiFi firmware

Source: https://blog.arduino.cc/2020/01/27/ardu ... -released/
mrguen
Posts: 24
Joined: Tue Mar 03, 2020 1:21 pm
Answers: 2

Re: Compile time so slow

Post by mrguen »

It seems there is mainly a bug in the gcc compiler

https://community.arm.com/developer/too ... to-compile

I am now trying to compile with IDE 1.8.12 and it takes tens of seconds to compile one file. Total time more then 10 minutes... impossible to use at the moment.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Compile time so slow

Post by fpiSTM »

mrguen wrote: Tue Mar 03, 2020 1:33 pm It seems there is mainly a bug in the gcc compiler

https://community.arm.com/developer/too ... to-compile

I am now trying to compile with IDE 1.8.12 and it takes tens of seconds to compile one file. Total time more then 10 minutes... impossible to use at the moment.
Right the 8 version got an issue, I met it even under Linux. This has been solved.
Finally we used the version 9 now...

With version 1.8.12 the compile time is better. If you reach 10 min then open an issue on Arduino side. My guess is you met an issue with your system config and Arduino (Firewall, antivirus,...).


For example, build a blink tooks around 1min30s for the first build, then the next build tooks only 10s thanks the cache even if I change a parameter in the sketch.
mrguen
Posts: 24
Joined: Tue Mar 03, 2020 1:21 pm
Answers: 2

Re: Compile time so slow

Post by mrguen »

Just tested Blink compilation this morning. It took 2m40s on my Icore 4570 / Windows 10 system. So, yes for a sketch that uses around 30-50% of the resources it takes more than 10 minutes. I really can't see a difference when deacivating AVG antivirus. I really can't go into any details. The architecture of the library seems very complex. But I would really be surprised if that all this compiling all the time was really needed.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Compile time so slow

Post by fpiSTM »

Again mrguen, I could not help on this.
you don't want to make the effort to understand but open an issue on Arduino side.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Compile time so slow

Post by ag123 »

try using an ide e.g. vs-code that has incremental build and that don't use temporary folders. that would take longer for the initial build but subsequent build is incremental and things are normally much faster with incremental build. the build takes a long time in part due to the huge feature set and all the supported mcus bundled with HAL, stm32 libraries, cmsis etc. it needs to evaluate large number of dependencies during the build and is part of the reason.
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: Compile time so slow

Post by fredbox »

Arduino 1.8.12 on Linux, STM core 1.8.0.
For a small program it takes 22 seconds to compile the first time.
After adding or deleting a line, recompiles take about 3 seconds.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Compile time so slow

Post by fpiSTM »

Right it is at least 10x faster on Linux or MAC.
Davor
Posts: 1
Joined: Fri Mar 06, 2020 10:39 am

Re: Compile time so slow

Post by Davor »

First compile time for blinky example on my Windows 10: 100sec.

Same thing with these folders added to exclusions from Windows Defender antivirus: 75sec.
C:\Users\USERNAME\AppData\Local\Arduino15\
C:\Program Files (x86)\Arduino\
Windows Defender is still very active in final phase of compiling (up to 80% CPU for the last 30sec).

Same thing on Linux virtual machine in VMware player: 25sec.
Post Reply

Return to “General discussion”