Go Down

Topic: Unbelievable slow compilation of simple sketches (Read 61471 times) previous topic - next topic

jjnoui

 :)
Good evening
Suddenly, tonight, compilations of sketches like the famous blink take a lot of time (more than a minute).
I was ready to reinstall Arduino but ...
I had the chance to browse this forum and try something else before.

In less than 40 seconds I have:
  - 1 Disconnected my network card,
  - 2 disabled AVAST Internet Security (the paid version)
  - 3 started a compilation
  Result: OK
 
  so :
  - 1 restart AVAST
  - 2 exclude the program files directory (x86)
  - 3 reactivate the network card
  - 4 start a compilation
  Result: OK
 
  Conclusion:
 
  I could have started directly with
  - 1 exclude the program files directory (x86)
  - 2 start a compilation
 
  2 nd conclusion:
 
  Thanks to all participants in this thread!

ballscrewbob

Not sure what the 2nd conclusion was..maybe start compilations ?


However you missed a couple of folders.

Slow compiles under Windows
Add the Arduino directories to your antivirus / anti malware / other security exclusions.

So that would be at least two of the following.

C:\Program Files (x86)\Arduino
C:\Users\yourname\AppData\Local\Arduino15      depends on IDE
C:\Users\yourname\AppData\Roaming\Arduino15   depends on IDE

If you have your sketches set up in a different location it's also worth adding that directory to the exclusions also. (reason being that there are Libs in there)

Additionally if you also use the online IDE "CREATE" the following directories.

C:\Users\yourname\AppData\Roaming\ArduinoCreateAgent
C:\Users\yourname\AppData\.arduino-create

If you have installed to a different drive swap the drive letter as needed.
If you also have an unzipped IDE installed that path should also be added to exclusions.


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.

jjnoui

Hi Ballscrewbob

I tried to write in English (I am French ...), so even if in my last message English seems correct? Content has been disrupted:

I forgot to name the directory where Arduino is installed, it was necessary to read:
C: \ Program Files (x86) \ Arduino

My different programs are in differents folders and are not excluded from Avast.

I did not encounter any particular slowdown by excluding only C: \ Program Files (x86) \ Arduino


For the second conclusion, you should read:

2nd conclusion: Thanks to all participants in this thread!

To avoid losing myself in my memories of English this time I used Google to translate;)

mvackel

Hello,

I'm experiencing this slow compilation since a while - and couldn't find the cause yet. Maybe some good soul can help!    :-)

I've tried:
- upgrading versions,
- turning off the antivirus,
- deleting any security software,
- deleting everything related to Arduino (that I know of) on the computer and reinstalling,
- everything I could find in forums, etc.

but nothing seems to solve the problem. Maybe the slow compilation is related to some another installed software.


Using Arduino IDE version 1.8.2

Windows 10

Tested on 2 computers:
- I7-3770 CPU @ 3.40GHz and 24GB memory (fast computer) every disk is SSD
- I5- 6200U CPU @ 2.3GHz, 8GB memory, also SSD


Compilation times for the Blink.ino example:

Board           I7 - 1st compile     I7-2nd compile       I5-1st compile     I5-2nd compile

ESP8266         1min40"                   26"                        14"                     3"
Yun                  53"                         9"                           6"                     3"
Uno                  51"                         8"                           5"                     2"        


As can be noted, the "fast"  I7 compilation times are _much_ longer then the "slow" I5.

As you may know, this is _very_ annoying when programming.

Please help!

Thank you.

CrossRoads

Got any Bluetooth stuff running? That was causing issues in the past.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

ballscrewbob

@ mvackel

Attaching a couple of help sheets.

Go through them and if you hit anything that helps at all please let us all know as feedback is always useful (even if its bad feedback).

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.

mvackel

@ CrossRoads:  No. There is nothing related to bluetooth in the computer.


@ Ballscrewbob:

I've just tried everything related to slow compilation in the files you attached. Makes no difference... :-(

When I change the compiler to verbose in "preferences", there are many lines that go slowly, compiling the core (1st time compilation):

8 times, lines similar to this one: (about 1/second):

"D:\bin\Arduino\hardware\tools\avr/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_YUN -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8041 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Yun"' "-ID:\bin\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\bin\Arduino\hardware\arduino\avr\variants\yun" "D:\bin\Arduino\hardware\arduino\avr\cores\arduino\WInterrupts.c" -o "C:\Users\Mack\AppData\Local\Temp\arduino_build_599560\core\WInterrupts.c.o"



17times, lines similar to this one: (about 1/second):

"D:\bin\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_YUN -DARDUINO_ARCH_AVR  -DUSB_VID=0x2341 -DUSB_PID=0x8041 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Yun"' "-ID:\bin\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\bin\Arduino\hardware\arduino\avr\variants\yun" "D:\bin\Arduino\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp" -o "C:\Users\Mack\AppData\Local\Temp\arduino_build_599560\core\HardwareSerial.cpp.o"



25 times, lines similar to this one: (about 2/second):

"D:\bin\Arduino\hardware\tools\avr/bin/avr-gcc-ar" rcs  "C:\Users\Mack\AppData\Local\Temp\arduino_build_599560\core\core.a" "C:\Users\Mack\AppData\Local\Temp\arduino_build_599560\core\Stream.cpp.o"



For the second compilation, it seems that this single line takes most of the time (about 2 seconds):

"D:\bin\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega32u4  -o "C:\Users\Mack\AppData\Local\Temp\arduino_build_599560/Blink.ino.elf" "C:\Users\Mack\AppData\Local\Temp\arduino_build_599560\sketch\Blink.ino.cpp.o" "C:\Users\Mack\AppData\Local\Temp\arduino_build_599560/..\arduino_cache_153451\core\core_arduino_avr_yun_031452209fed551ef268e3455c03964e.a" "-LC:\Users\Mack\AppData\Local\Temp\arduino_build_599560" -lm



I'll repeat the tests after reinstalling ESP8266 support.


Another idea: I had the gcc compiler installed on this computer (but removed it about one year ago). Couldn't find anything remaining. Maybe there is some connection...



mvackel

For the ESP8266 second compilation in verbose mode:


There are 49 lines like this: (about 2 per second):

"C:\Users\Mack\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-ar" cru  "C:\Users\Mack\AppData\Local\Temp\arduino_build_495010/arduino.ar" "C:\Users\Mack\AppData\Local\Temp\arduino_build_495010\core\cont.S.o"



ballscrewbob

#38
Apr 04, 2017, 08:11 pm Last Edit: Apr 04, 2017, 08:12 pm by Ballscrewbob
If you ran both CCLEANER and WISE then the chances of finding anything left over from gcc compiler are pretty slim.

Most of the common factors are computer security, malware or virus, boards with something else connected to it, Wifi or bluetooth or other communications modules attached to a board


ANother common fix (not 100% guaranteed to help) is to remove the arduino 15 folder or rename it.
If you have other custom URL's in your IDE for boards then better just to back that folder up and rename the original rather than delete.

My preference for that method is just to add ".org" to the end as I use that to indicate and original copy.
Then once the folder is rebuilt by the IDE I often just copy the URL's from the original prefs back into the new one and then also aim it at my usual sketches folder.
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.

mvackel

@ Ballscrewbob

CCleaner does not report any problem in the registry.

I have no board connected to the computer - just compiling the script (no upload, no board).

I think there is no threat like virus or malware, as the antivirus (AVG) is up-to-date.

I've already removed everything related to Arduino (as far as I know: Arduino installation folders, any "Arduino15" folders, registry entries).

Made a clean install. Same results.... :-((

I suspect that there is something related to gcc as the verbose compilation shows that it's going slowly.

Any suggestion about where to seek for the problem?


ballscrewbob

#40
Apr 05, 2017, 01:27 am Last Edit: Apr 05, 2017, 01:29 am by Ballscrewbob
CCLEANER is very mild for registry use and I only use that to get rid of the crud.
Thats why I use the WISE reg cleaner as it is much more thorough.

As for antivirus.
NEVER and I do mean NEVER trust a single AV as a sole source of protection.

I have a very specific routine for clients computers that are even slightly suspect.
It is a little time consuming but has seen me recover more systems than I could probably remember (Including my own if the wife has been playing online without taking notice)

The GCC issue is not something I know too much about and will freely admit that there are people around here who are waaay much better in that regard.
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.

mtabarelli

I had the same issue today. Found out that I had a G buster browser defence installed because of my internet banking.
 
Everytime I tried to compile something I could see on the task manager that the avr-gcc exe would launch and right after it would abort. While that happened I could see the G buster consume more ram, so I was just a matter of connecting the dots.

Uninstalled the  G buster and problem solved, compiles simple examples in a second.

Try using the task manager in your favor. Hope this helps

paulhdietz

I too started having the slow compilation issue. It takes minutes to just compile Blink for Uno. Larger programs never complete - at least not within the limits of my patience. I've tried just about everything people have discussed, and then some. (e.g. create an entirely new user, running directly from unzipped install) Nothing improved the situation.

I did try one thing that might help someone else figure out was is happening. You can see the commands that are being run if you turn on verbose mode. Each is executing very slowly. So I tried some of these commands, launching them in a separate CMD window. And they ran just as slow.

I am running Win10, and Arduino 1.8.6 (tried various versions, all with the same result). All was running well previously, and then this problem suddenly arose. It is only happening on my laptop. My desktop continues to work just fine with all of the same versions.

I see lots of people are having this problem. A fix would be greatly appreciated!

Thanks!

--- paul

ballscrewbob

#43
May 31, 2017, 03:08 am Last Edit: May 31, 2017, 05:07 am by ballscrewbob
@paulhdietz

Trouble is there is no "single fix" so asking Arduino to fix it is like looking for rocking horse droppings...

Even two versions of the same windows install will be different between hardware and then add to that the amount of different security levels and programs in use along with so many other unknown factors and the task is best dealt with on a case by case basis.

What security are you running ?
Have you added all the Arduino things the your security exclusions ?
What intrusive features of windows 10 have you left running ?
Are you just a "USER" of the computer or do you have "ADMINISTRATOR" rights or do you even have access to the FULL ADMINISTRATION account ?
Are all your hardware drivers up to date and not just the default windows offerings ?
Do you know how to use "process explorer" to track errant services and applications... not task manager ?

There are lots more things too so maybe just take a peek at this particular post Its an oldie but its a goodie.


EDIT also noticed you said 1.8.6 should that not be 1.8.2 (unless you got it somewhere else in which case you may be in the wrong place)
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.

dimitrisp

@ballscrewbob
Thank you.
You saved my day.  :)

Go Up