Slow compilation

Hi I am having a problem with compiling for the esp32 c3 module. I am finding the compilation is slow - it is taking over 10 minutes to compile . Are there any other options ?

Off the top of my head I can't think of anything that would speed that up. Do you have any 'remote' paths like NAS or maybe a spot on disk going bad (run a thorough disk health app to check)
Do a verbose compile then load the log into an editor and manipulate it to create several reports, one by time to see if there is a single spot where it's running slow, one by path to see if there are any remote paths, and maybe an analysis that shows the sheer number of libraries being compiled. You may have unneeded libraries.

Hi I am trying to see if it just my situation or this is a common problem . I have taken a video of my compilation with verbose compilation and upload output . Possibly that would give you and idea of why it is taking so long . It seems to take a lot longer when I have a wifi include in the mix

Your question has been split from an existing topic. Assumption is made that you're using IDE 2.x, please confirm.

Please do not hijack unrelated topics!

Hi Yes I have actually tried the older version as well . My observation is that for any wifi include it is about 10min - with only one include

ESP32 based boards are notorious for slow compilation.

I did compile the BasicHTTPClient example for the ESP32C3 dev module.
First compile took approx 70 seconds, next compile (no changes) took approx 15 seconds.

Win11, I3-1220P, 16GB memory, SSD
IDE 2.3.8, ESP platform 3.3.8

Yes it is. ESP32 compiles are known to be rather slow particularly if there is 3rd party libraries involved. Once a compile of the sketch has been successful and libraries don't change, then cached versions of that compile tend to be used and should speed things up, but even then on my I7 laptop a 2 minute compile time is normal, which has prompted me to add an audio signal when the compile completes.

I have also found that compilation can take near forever while i am not connected to the internet somehow (??) or at least this is what happened during my holidays and once i was home the issue was reduced.

Is the compile slow only for the ESP32, or are all boards compiling slower than expected? Antivirus programs have been known to interfere with the compiler in the past.

NO video, post the actual verbose compiler output.

Is the computer you are running the IDE on a networked machine? Is it at work, is it at school?

No I am connected to a 5Ghz fibre . I have a desktop with a solid state drive 64bit windows 10
10 Gbit ram

Do you have a NAS, what is the fibre connected to?

the fibre router is very fast - I have a solid state drive . The problem is more to do with wifi include files which are very slow .

I am trying to find where the verbose output is logged ?

Hi @rbettes. I'll provide instructions you can follow to get the verbose compilation output:

  1. Select File > Preferences... from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compile" in the "Preferences" dialog.
  3. Click the "OK" button.
    The "Preferences" dialog will close.
  4. Compile your sketch, just as you did before.

You will now see verbose output detailing the operations performed to compile your sketch printed in the black "Output" panel at the bottom of the Arduino IDE window.


ⓘ Although the verbose compilation output is useful in the specific case where you want to get low level details of the compilation process, the additional information produced by the verbose setting is not typically useful for normal sketch development usage. Furthermore, the additional output can even have a harmful effect under normal usage because the greatly increased volume of output can make it more difficult to notice and read valuable warning messages from the compiler.

For this reason, I don't recommend leaving the verbose compilation preference enabled for the average user.


Any included header files need to be compiled at least once for every sketch. It is just compilation processing that takes the time. The faster your compiling processor, the faster it will be done.

BasicOTA (Examples->ArduinoOTA->BasicOTA) takes my laptop 105 seconds the first time, but after a successful compile, the 2nd time around it does it in 35 Seconds. (ESP32 core 3.3.8)

You can benchmark yours to compare.

as i stated before i have also waited for nearly half an hour for a compile when it was a much bigger project with many libraries, some of which are rather extensive. All of the files in those libraries (and their dependencies) need to be compiled, also functions that are not used. (although these are not included in the final binary of course)
Once these libraries have been compiled they should be cached and unless there is a change to those files, should not have to be compiled again (there is exception to this rule involving switching boards or maybe even closing and re-opening the IDE, i don't know, haven't cared)

This of course can be super annoying if the compilation fails due to some typo or missing ; or { or something like that. So if you have a larger project that uses included libraries, start out with a sketch that actually does compile already, so the whole compilation of those libraries can be skipped next time even if there are errors.

I have had reports that compilations on Linux machines are significantly faster !

If you don't want to answer my questions then I can't help you.

Yes some of mine take agggeeeeeeess

Worse with esp32 ‘s . I have no proof , but more libraries = slower?? , maybe it has to trawl a lot of them to find what it needs ??

The OP did answer (some) of your questions.

Regardless there is no real solution for this issue as far as i know. Searching through the forum should show several topics about it, all without solution.

Not the question that mattered. We have no idea what his include search paths look like. My post 2 is how I go about researching these kinds of issues.
After all that it may be 'normal', but 10 mins is forever in computer terms.