Go Down

Topic: Arduino IDE compiling *very* slowly on Windows 7? (Read 5120 times) previous topic - next topic

sheffieldnick

Even very simple sketches take an age to compile on my Windows 7 machine. e.g., example "Blink" takes 34 secs to compile the first time :( :( and 15 secs subsequently because most of the compiled objects are being reused. Any suggestions? I've already tried:

1. Up to date Arduino IDE software? No, it's the latest v1.8.1
2. Slow old machine? No, it's a modern Skylake CPU with plenty of RAM, nothing else running, not swapping memory to disk
3. Slow network? No, broadband is working fine
4. Failing/slow hard drive? No, it's a very fast SSD with plenty of free space
5. Slow upload to device? No, that is just the compile-only time, without uploading
6. Paths with spaces in? Possibly, but not work folders, only the executable program + support files. And wasn't that bug fixed in an old version of Arduino IDE?
7. AntiVirus interfering? No, only Windows Defender (anti-malware, not anti-virus in Win7) and I've stopped it monitoring my Arduino paths
8. Bluetooth interfering? No, disabled bluetooth on machine
9. Not Linux? Yeah, helpful! :P

The first 2 commands are the really slow ones, taking around 10 seconds to complete. Verbose logging:

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Nick\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Nick\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries D:\Arduino\libraries -fqbn=esp8266:esp8266:d1_mini:CpuFrequency=80,UploadSpeed=921600,FlashSize=4M3M -ide-version=10801 -build-path C:\Users\Nick\AppData\Local\Temp\arduino_build_961583 -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\Nick\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2 -prefs=runtime.tools.esptool.path=C:\Users\Nick\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9 -prefs=runtime.tools.mkspiffs.path=C:\Users\Nick\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\0.1.2 -verbose C:\Users\Nick\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\esp8266\examples\Blink\Blink.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Nick\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Nick\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries D:\Arduino\libraries -fqbn=esp8266:esp8266:d1_mini:CpuFrequency=80,UploadSpeed=921600,FlashSize=4M3M -ide-version=10801 -build-path C:\Users\Nick\AppData\Local\Temp\arduino_build_961583 -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\Nick\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2 -prefs=runtime.tools.esptool.path=C:\Users\Nick\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9 -prefs=runtime.tools.mkspiffs.path=C:\Users\Nick\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\0.1.2 -verbose C:\Users\Nick\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\esp8266\examples\Blink\Blink.ino

Many thanks

pert

7. AntiVirus interfering? No, only Windows Defender (anti-malware, not anti-virus in Win7) and I've stopped it monitoring my Arduino paths
anti-malware or anti-virus, same difference. Which paths specifically? I think the most important one is the temporary build folder, which changes every time you open a new sketch or restart the Arduino IDE.

sheffieldnick

Which paths specifically? I think the most important one is the temporary build folder, which changes every time you open a new sketch or restart the Arduino IDE.
C:\Program Files (x86)\Arduino
C:\Users\Nick\AppData\Local\Arduino15
C:\Users\Nick\AppData\Local\Temp
D:\Arduino

I've also tried switching off Windows Defender 'Real-time protection', but compile time is still the same.

pert

Ok C:\Users\Nick\AppData\Local\Temp is where the build folder would be so it looks like you have indeed excluded all Arduino paths. 34 and 15 seconds seems pretty much normal. Unfortunately some of the improvements made in Arduino IDE 1.6.6 and newer had the side effect of making compilation much slower. They have been doing some work lately on caching files to speed up compilation so give the newly released Arduino IDE 1.8.2 a try and see if that helps at all.

sheffieldnick

Thanks, just tried 1.8.2 but no improvement in compile times. 15-34 secs seems ridiculously slow for a modern computer compiling a small source file + some small libraries. My 4MHz ARM2 felt faster nearly 30 years ago...

I've read posts from users running Arduino IDE on Linux saying compiling a small sketch takes 2-3 secs?

pert

Try out 1.6.5:
https://www.arduino.cc/download_handler.php?f=/arduino-1.6.5-r5-windows.zip
The difference is quite shocking. Whenever I temporarily go back to that version or older for backwards compatibility testing or providing support for someone using an old version I'll be sitting there waiting for the compilation to finish for a minute before I realize that it finished so fast I didn't even notice.

sheffieldnick

Try out 1.6.5:
https://www.arduino.cc/download_handler.php?f=/arduino-1.6.5-r5-windows.zip
The difference is quite shocking. Whenever I temporarily go back to that version or older for backwards compatibility testing or providing support for someone using an old version I'll be sitting there waiting for the compilation to finish for a minute before I realize that it finished so fast I didn't even notice.
Thanks, I'll try 1.6.5 out tomorrow.

After a reboot (which always helps Windows sort its life out?) I'm now getting compile times from 4 secs to 30 secs, which is quite an improvement, but seems really inconsistent - not sure why it sometimes manages quite a reasonable speed (4 secs) but most of the time doesn't.

I noticed the verbose logging now has a red line:
"Archiving built core (caching) in: C:\Users\Nick\AppData\Local\Temp\arduino_cache_588400\core\core_esp8266_esp8266_.... .a"
but I'm not sure it uses that cache file in a subsequent re-compile/upload ?

pert

I think it does but I only just now installed 1.8.2 so this feature is new to me. I see there is now the option File > Preferences > Aggressively cache compiled core. I'm kind of surprised to see that added because they have been reluctant to make the preferences intimidating to beginners, I'd expect it to be a hidden preference only accessible by editing preferences.txt. You can get some more information on this feature here:
https://github.com/arduino/arduino-builder/pull/213

sheffieldnick

I think it does but I only just now installed 1.8.2 so this feature is new to me.
It certainly generates the file in 1.8.2, but looking at the compilation log, nothing seems to be using that file to speed things up? at least not on my system. Even with Aggressively cache compiled core switched on.

Going back to 1.6.5 is faster, but again not consistent. Most of my "Blink" compile times are 4-15 secs, with a few under 2 secs and a few at 20-30 secs! If I could get consistent 2-4 secs I'd be a happy coder...

Tempted to try it under Linux in a VM, just to compare!

pert

That 20-30 does seem strange with 1.6.5. I have read that part of the slowness on Windows is GCC itself runs slower on Windows. One thing to consider with reported results on Linux is many Linux users are using a modified version of 1.0.5 but think they are using the latest version of the IDE because the new versions are not in the package manager due to a licensing issue.

ballscrewbob

#10
Mar 25, 2017, 04:47 am Last Edit: Mar 25, 2017, 04:47 am by Ballscrewbob
Hi guys..

Was having some similar issues over the last couple of days.

Decided it was time for a full audit of my main win 7 box.
I have a profile for the wife on here too btw and that's IMPORTANT here.

I did all the usual stuff but was still getting unacceptable compile times.

Did the usual clean ups on my profile CCLEANER and WISE reg cleaner and nothing changed.
Logged into the wife's profile expecting to see it was already clean from the process on my profile.
Was I ever wrong...So cleaned up her profile too and dropped back to mine...
A little better but still not quite there.

Decided I needed to go deeper and seeing as I am pretty careful I went straight to the wife's profile again.
Ran ESET online scanner which found a heap of things (over 90) nothing too nasty and mainly PUP's but items that were not supposed to be there.
Nailed em all and did a reboot.

Even the boot time was improved.
Did the same scan for my profile and although it found a couple of items I knew what they were and was able to safely ignore them and nail a couple more that had somehow MIGRATED from the wife's profile.

Re did CCLEANER and WISE on both profiles which found remnants from the major ESET run.
One more re-boot and BOOM everything is up to speed and it feels like a new computer.

1.6.5 is about 12 seconds
1.8.1 is about 10 seconds
1.8.2 is about 8-9 seconds
CREATE is off the chart... just don't blink !

It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

yoloman

Disabled real time protection on defender after waiting up to one Minute and getting up to 50% CPU Load on windows defender.

Now it compiles the same code in under 4 seconds.

Go Up