To get the ChipID of my ESP32-CAM module or my ESP32 Dev module I load the Example sketch ChipID in the Arduino IDE version 1.8.19.
After pressing the UPLOAD button the Progress-window initially shows a very short green bar.
After 50 sec this short green bar disappears, seeing an empty Progress-window for another 60 seconds.
Then a new green bar begins to grow and after 60 sec the sketch is compiled.
Finally the upload to the module takes another 10 sec.
So a total time of 250 sec is used to compile this sketch.
Is this 250 sec a normal compilation time for such a short sketch?
I am using Arduino IDE version 1.8.19 on a Windows 10 pc with 16 Gb Ram and Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz 3.50 GHz
When I measure the compilation time with the same Arduino IDE version 1.8.19 using a Windows 11 laptop with 8 Gb Ram and Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz 1.99 GHz it takes 80 seconds.
PC and laptop have both the newest Windows updates.
Suppose 80 sec is a "normal" compilation time, what can cause such a difference between both systems?
curious to hear what others say
seems that the IDE doesn't really take advantage of "make" to only recompile the files that have changed. however, i believe it does just rebuild any libraries once
I don't have an esp32, so I tried an esp8266 program (I figured it would haul in a bunch of stuff like an esp32). First compile was about 43 sec. Changed a line in the source and recompiled. Second time tool about 9 sec. Second compile had a bunch of messages about
Using cached library dependencies
Using previously compiled file
So it appears that it was just recompiling the changed source.
Ubuntu 20.04.6 LTS, Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz, 16GB memory, Arduino 1.8.19
Thank you both for your contribution. I have discovered that an active data protection program is responsible for this additional delay in compiling time of more than 100 sec.
After temporary shutdown that protection program, the compiling time of the above mentioned Example sketch ChipID now took less than 30 sec. And the blinking LED for an Arduino Nano took less than 7 sec.
Issue solved.
I was aware that anti-virus/anti-malware apps can slow down compilation in the Arduino IDE. But I still thought compilation was taking too long (30-60 seconds) after I marked all my Arduino folders “safe” in my anti-virus software.
So I decided to try a “clean install” of the Arduino IDE.
This reduced compile time to ~5 seconds. 10 times faster than before.
However, as I added additional “boards” to the Arduino IDE then the compile times again began to increase.
As a test I then “uninstalled” the boards I wasn’t currently using. Compile times sped up to 5 seconds again after doing this.
So I think what happens at the very first stage of compiling a sketch is that the Arduino IDE searches for a “boards.txt” file for each installed board. Then it parses the contents of each “boards.txt” file. Some “boards.txt” files are rather large. Combining this with a situation where the user has installed a large number of boards is what causes this first part of the compile process to take such a long time.
This appears to occur each time a sketch is compiled whether or not any “pre-compiled” code has been cached by the Arduino IDE.
I’m continuing to research this and will share what I learn about it.
During the past month I tested many "Arduino compatible" boards with Arduino IDE 1.8.13.
Boards & MCU varieties included: STM8, LGT8F328P, ATmega328P, ATmega2560, ATmega644, ATtiny88, and Teensy. Therefore it was necessary to install numerous different "Boards" packages.
After doing this I can confirm that having a large number of boards packages installed greatly slows down compilation. I've observed compilation times >2-3 minutes. This is the case even when compiling an "empty" sketch.
But if all unneeded boards packages are "removed" (by using Arduino IDE boards manager) then compilation is often <5 seconds on my Windows 10 laptop.
For obtaining fastest possible compilation, individual "boards.txt" files can be edited by deleting all boards from the .txt file except the board currently being used. It should be noted that some "boards.txt" files contain data for 10, 20, or even more different boards. Note: Only experienced users should attempt modification of "boards.txt" files. Always save a copy of the original.
After repeating this experiment several times I believe the Arduino IDE parses every installed "boards.txt" file during compilation. Therefore compiling becomes slower and slower as more and more "boards" are put into the "installed" category.
Try it with a more current version of the IDE (like 1.18.19) and see what happens.
Where can I download that version from ?
More seriously, try version 2.1
It also improves things on a windows machine if you give arduino-cli.exe a higher priority.
EDIT: I forgot to mention I was referencing IDE 2.1
Scroll down to "legacy software" on the main Arduino download page.

I can confirm that having a large number of boards packages installed greatly slows down compilation.
Very useful info, thank you!

Scroll down to "legacy software" on the main Arduino download page.
No version 1.18.19 available for download on that page ...

Try it with a more current version of the IDE (like 1.18.19) and see what happens.

No version 1.18.19 available for download on that page ...
1.8.19, however, is available for download
OOPS, too many ones. I did mean 1.8.19.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.