Compiler Painfully Slow-Unuseable

I have been using the Arduino IDE for many years and have had no problems. Its great for generating code simply and getting projects up and running in the shortest time.
However, having returned to the IDE to develop a project the compiler is that slow it is unuseable. I have tried all the suggested solutions relating to antivirus software etc (Disabling/exceptions for Arduino folders, files etc.).
But the Compiler was still taking 10 minutes to compile an empty sketch!
I was just about to give up on Arduino and use a different IDE for development, it was that bad trying to resove the issue. The computer I am using is : A Dell Laptop XPS15 9500 I7-10750 2.6GHz 16GB RAM, Windows 11 Ver 22H2.
One forum user suggested removing Trusteer End Point. I stopped the Trusteer program running, but this had no effect. So I thought there can't be an issue here?
Anyway after days and days frustratingly trying to find a solution. I uninstalled the Trusteer End Point Software and Jack Pot the compiler does what it says on the tin compiles in seconds, thankfully I do not have to abandon the Arduino IDE which I really like.
So I just wanted users to be AWARE of the Trusteer End Point Sofware issue.
I have bitdefender antivirus running with no problems.
I would hate to think that new novice users encounter this problem and give up on the Arduino IDE or indeed coding in general.
Dave

2 Likes

What is a board (Arduino, ESP etc) for which you compile the code?

No, you are the first user in years to comment on this topic.

What board are you compiling for? Some will take longer than others. But none should take 10 minutes.

I gave up on the IDE way back not because it was slow compiling, but because it was slow to load. So I started using arduino-cli and my favourite lightweight IDE (Geany) and haven't looked back.

On a Raspberry Pi 4, using arduino-cli, I can compile an empty sketch for an Arduino R3 in 4 seconds.

For an Arduino R4 minima, it takes 31 seconds.

For an Arduino R4 WiFi, it takes 43 seconds.

For a Wemos D1 mini, it takes 29 seconds.

For an AI Thinker ESP32-CAM, it takes 30 seconds.

And yes, all the times are with no previously compiled/linked bits left over in the /tmp/arduino directory. So they're all worst case times. Not having to re-compile the core on subsequent builds would shave quite a bit off those times.

1 Like

The target board is a SAMD21 MO mini. Once I remoced Trusteer End Point all good now.
Just one to watch out for.

1 Like

I am also having issues with the Arduino speed.
I have a decent computer (SSD, 64Gb RAM, Ryzen 3700), but it takes forever to do whatever magic it does between pressing the upload button and actually uploading it, even if I just verified the code prior to uploading it. It's not even a big code, less than 1000 lines of code, for ESP32.

Hi @raduprv. As @davebrough discovered, this sort of problem can be caused by security software/antivirus software on your computer.

It is not limited exclusively to the "Trusteer End Point" software that affected @davebrough. When people report exceptionally slow compilations, we often find that it was caused by security/antivirus software on the user's computer. Arduino IDE creates a large number short duration processes during the compilation. Some antiviruses do "real-time" scanning of processes. The process is blocked until the scan is completed. The added time for each scan is quite significant in relation to the duration of the process, so the total impact of the many scans is a great increase in the length of the compilation.

As an experiment, you can try :warning: TEMPORARILY :warning: disabling the security software/antivirus on your computer for a single compilation to see if the problem goes away:

  1. Disable the security software/antivirus software.
  2. Compile the sketch, just as you did before.
  3. Wait for the compilation to finish.
  4. Immediately enable the security software/antivirus software again.

If the problem doesn't occur with the security software disabled, you will need to adjust the settings of your antivirus to put the appropriate file, folder, or process on the "allow list" so it doesn't interfere with compilation.

:warning: Please be cautious about working without an antivirus. This is only about temporarily disabling it for a quick test. If you don't feel comfortable doing that, fine. You can try going straight to configuring the antivirus to not interfere with the Arduino software.


Arduino IDE does caching during compilation, so subsequent compilations will be faster than the first one. So make sure to not let that throw off your results when you are comparing compilation time.


Thank you for replying. I am only using Windows Defender. Is there an up to date guide on how to put the Arduino related paths on the exception list?

Not that I am aware of. Something you might find useful if you find you do need to configure your security software is enabling verbose output during compilation. When verbose output is enabled, Arduino IDE prints all the commands it invoked during the compilation operation to the "Output" panel at the bottom of the Arduino IDE window:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compilation" in the "Preferences" dialog.
  3. Click the "OK" button.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. Wait for the compilation to finish.

Examine the contents of the black "Output" panel at the bottom of the Arduino IDE window. You will need to scroll up in the panel to see it all.

If you watch the verbose output during the compilation operation, it might tell you whether it is only specific processes that are taking an exceptional amount of time. If so, you can focus your attention on those processes while not worrying about the ones you can see completing very quickly.

Thanks.
I did that, and it seems there were a lot of small steps which each took a bit of time. However, the following two parts took a few seconds:
"C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\esp-2021r2-patch5-8.4.0/bin/xtensa-esp32-elf-g++" "-Wl,--Map=C:\Users\Administrator\AppData\Local\Temp\arduino\sketches\161897291BE8A009D8F7DE173D262B79/macro_slider.ino.map" "-

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.