HI, I may have asked about compile times in the past, but am still very bothered by how long they are with the Arduino 1.8.19 IDE. So, I’d like to ask the audience for some benchmarking.
Here is the simplest code I can think of:
void setup() {
bool test = false;
}
void loop() {
}
I’ve run this just after startup, and it takes almost 2 minutes to compile (I just hit the compile button – not the compile/download). When I turn off the wifi, and turn off ALL security apps, I get 36 seconds (but that’s probably because it’s doing some caching). When I restart the IDE from fresh and all wifi and security on, I get 1 minute 12 seconds. I get the same results whether I use the “ESP32 dev module” or the “ESP32S3 dev module”.
How can a nonsense program like that take so long without wifi and security (I have a fast PC)? (my serious programs can take 6-8 minutes with wifi and security on, and are driving me to serious multi-tasking).
What is your experience with this program? Thanks!
Hi.
That’s a very long time to compile. That never happened to me.
One program like that will take like 5 seconds to compile or less.
Where do you have your ARduino IDE installed? Do you have the ZIP installation?
Have you tried with a new installation?
Regards,
Sara
Hi Sara …. so I completely cleaned out my PC of anything to do with Arduino (i.e. in ProgramFiles(x86), in Users/xxx/Documents, in Users/xxxx/AppData/Local — no remnants of Arduino). Then I did a reinstall, adding the link for the Board Manager (i.e. https://dl.espressif.com/dl/package_esp32_index.json ) in Preferences. (my install is on the C: drive, and the programs are in the /Users/xxx/Documents/Arduino folder; no, I’m not using the zip installation – just the arduino-1.8.19-windows.exe file)
For the very same code listed above, here is what I get for compile only:
For board = Arduino Uno:
– restart IDE: takes 12 seconds to compile (THAT’s A GREAT IMPROVEMENT OVER THE PREVIOUS RESULTS)
– change the constant w/o restart: takes 9 seconds
For board = ESP32S3 dev module:
– restart IDE: takes 1 minute 7 seconds
– re-run w/o changing anything: takes 36 seconds
(I tried removing the Board Manager link in preferences – no change)
These are very long compile times for a nonsense program, even when the board selected is Arduino Uno! … when I do my “real” program (~800 lines of code), it takes over 6 minutes to compile !!!
Any ideas on what this could be due to? Thanks for any help 🙂
Hi.
Yes. That’s definitely a long compiling time.
Unfortunately, I don’t have any idea why that might be hapenning to you.
Sometimes, antivirus software may cause that.
Regards,
Sara
Hi Sara. So I explored in more detail what is happening when that simple program is compiled after the IDE is just started, and also when complied due to a small change in the one and only constant. I enable “Show verbose output during compilation” in the File/Preferences page.
This is a “busy” response, but I would love your help in either trying to reproduce the simple code with the ESP32S3 Dev Module “board” (which is what I use), or helping me find someone/blog who can explain this unusual behavior I’m experiencing. Here is what I experience on my “fresh install of Arduino 1.8.19” on my “wifi-disconnected”/ security disabled PC.
Arduino Uno “board” selected: Here is what happens when the compile button is hit:
1) arduino-builder is run with -dump-prefs and lots of other switches
2) arduino-builder is run again with -compile switch, and the same bunch of other switches
3) “Using board ‘uno’ from platform
4) “Using core ‘arduino’ from platform
~~~~~~~~~~~~ this much takes 15 seconds, both when the IDE is first started and the code compiled, and the constant in the cost is changed and recompiled~~~~~~~
~~~ the next section takes 5 seconds when the IDE is first started, but takes 2 seconds when just the constant is change & recompiled ~~~
5) Detecting libraries used
6) Generating function prototypes
7) Compiling sketch
8) Compiling libraries
9) Compiling Core
10) Linking everything together
…. total for this nonsense code: ~20 seconds initially, 17 seconds with small change
ESP32S3 Dev Module “Board” selected: Here is what happens when the compile button is hit:
1) – 4) (same steps 1-4 as above), takes ~31 seconds when the IDE is first started code compiled, and when constant changed/recompiled
5), 6) (same steps as 5-6 above), takes ~ 12-14 seconds when IDE first started the code compile, and when constant changed/recompiled
7) Compiling sketch – takes ~33 seconds when IDE first started the code compile, and ~6 seconds when code changed/recompiled
9), 10) (same steops as 9-10 above), takes ~11-13 seconds both when IDE first started, and when code changed/recompiled
…. total for this nonsense code: ~1minute 30 seconds initially, ~48 seconds with small change
It is clear that something is wrong if others are experiencing significantly shorter times. These results are the same whether I have WiFi and security on, or completely off. In the “compiling core” section, when the IDE is first turned on, it runs hundreds of includes (takes pages and pages during 33 seconds) and does irrelevant things like include/wpa_supplicant, include/esp_websocket, include/esp_led…. as nauseam ! When run a 2nd time, it uses “precompiled core” so it saves the 33 seconds, but both runs do all the rest of the 45+ seconds of stuff.
Again, if you could try to reproduce this for this simple circuit using ESP32S3 Dev Module board, I would really appreciate it; otherwise, do you have someone/some link to write to about this ?
Thanks !
Hi.
What type of Arduino IDE installation do you have?
Is it the . ZIP install? Where is the folder located? Is it on the Desktop or located inside many other folders?
Do you happen to have the Arduino installed inside Google Drive folders?
I don’t know how I can reproduce that issue on my system because I’ve never have such long compilation times.
I also searched this issue on some forums, but the issues I’ve found are very outdated (like from 2017).
Alternatively, you can try using another IDE like VS Code (but it may take a little for you to get used to it).
Regards,
Sara
Hi Sara … I installed the IDE using arduino-1.8.19-windows.exe, which I downloaded (recently, again) from the Arduino website. The executables are in the usual place: Program Files (x86)/Arduino, and the program files are in the C drive at /Users/xxxx/documents/Arduino, which seems to be the default place for them (I usually don’t have them there, but with the re-install, decided to keep things simple). I would still be interested in the time it takes for your system to compile the simple program using the ESP32S3 Dev Module – I need to have at least 1 data point of “proper operation” … thanks.
I do prefer VS Code, but most of your tutorials are using the Arduino IDE, so that’s why I stuck with it. It’s crazy that I can’t find any blog site to get help on this … oh well (I too found only outdated sites and un-helpful info). Thanks for your help though 🙂
Hi.
When I compile for the first time it takes 34 seconds.
Second time, it took 12 seconds.
I’m sorry that I can’t help much with this issue.
Regards,
Sara
Thanks Sara for you help – I appreciate it! I did the same thing on a laptop, and though times were shorter, the 2nd time still comes in long at 38 seconds – your 12 seconds is more reasonable. I am going to migrate to VSCode, but will try to understand the Arduino IDE issue, so if you don’t mind, can you leave this question open? (my PC has an Intel i7 350Ghz, and the Laptop an Intel i5 333Ghz; performance testing (using PCMark 10) on these 2 show the PC being slower than tests by other people, but the laptop as expected … I’ll figure this out at some point!).
as an FYI — in VSCode/PlatformIO (using Arduino framework), the simple program takes 50-55 seconds 1st time, and ~20 seconds after changing the constant and recompiling. (the good news is that the complex program, which before took ~6 minutes, now takes ~1 1/2 minute 1st time, and ~30 seconds with a recompile … significant improvement using VSCode over Arduino IDE !!!
I’m not going to waste anymore time with the Arduino IDE, so you can close this question.
By the way, a project is “more portable” in VSCode if you manually install the libraries, versus using the “Transfer Arduino Project” found in the PlaformIO home (and mentioned in one of the blogs) – this latter process links to stuff in the C:/Users/documents/Arduino/libraries folder; manual install puts them in the project location without any links)
Hi.
Thanks for the follow-up.
I always recommend creating the project from scratch in VS Code and installing the libraries so that you don’t have compaitbility and library issues.
I’ll mark this issue as resolved for now. If you need further help, you just need to open a new question in our forum.
Regards,
Sara
This is a fascinating issue I wish I could help with this. I wonder if there is an initial compile time that stays at say around the 2min mark, but then it may not change that much for say a program with say 800 lines. That is the 800 line program, would take say 2 mins and 10 secs.
I have been trying to use the so called AI sites like ChatGPT and it is interesting they seem to do OK on Fuzzy non technical issues nearly every time I have asked a deep question on a technical question you can see it has no curiosity or understanding.. This AI stuff is overhyped. Anyway this is a fascinating problem
Yes, it’s an interesting issue. Creating an image using compiled code (C or C++), requires first compiling it, pulling in all the includes, then uploading it. As far as I can tell, Arduino IDE does not save the results of a compile and every time a compile is requested, even on the same code, it starts over again (at least that is my experience, watching the compiling happen). With VSCode, that is not the case – in the file structure is the compiled stuff, and a recompile takes a very short time. I’ve switched to VSCode for all ESP32 stuff, but for things like Seeed R2040 devices, Arduino IDE is a must (VSCode doesn’t yet support it). With the Raspberry Pi, you can use Python, which is not a compiled code, and it takes literally seconds to move the code to the device using a program like winSCP (i.e. Secure CoPy). Thanks for the comments – I don’t think what you are suggesting is happening.