Arduino Forum

Using Arduino => Installation & Troubleshooting => Topic started by: ROVguy on May 29, 2019, 02:47 am

Title: Dead slow IDE
Post by: ROVguy on May 29, 2019, 02:47 am
Hello all.

I'm having issues with speed of Arduino IDE.
PC: SurfacePro 3 and SurfacePro 6
Arduino IDE 1.0.6, 1.8.8, 1.9.0

I was using my SP3 win10 and upgrading the Arduino IDE as new versions came available stopping at 1.8.9. I didn't have any issues with the IDE. IDE would boot in about 5sec.
 I had to replace my SP3 so I got the latest SP6. When I installed Arduino IDE 1.8.9 the bootup takes about 55sec to start the IDE, opening a sketch takes about 50 sec, compiling and saving it also took 50 sec. I replaced the IDE with 1.9.0 and had very similar results. Dead slow. Disabling virus and threat protection had no visible change on speed. I finally replaced the IDE with 1.0.6 and I got my speed back. Bootup, saving and compiling that same program takes about 5 seconds.

Does anyone know how to rectify this?
Thanks
Title: Re: Dead slow IDE
Post by: pert on May 29, 2019, 02:53 am
Try creating a file named portable in the Arduino IDE installation folder and see if that has an effect. The presence portable folder will cause the Arduino IDE to run in portable mode and not rely on any external folders. If those external folders were on a network drive or onedrive or whatever, that might explain the slowness.
Title: Re: Dead slow IDE
Post by: ROVguy on May 29, 2019, 01:33 pm
Everything is saved within C drive. No network, external or cloud folders. After creating a portable folder within the IDE installation folder on C drive the IDE doesn't boot at all. You see the IDE pops open for a moment and then disappears. 
Title: Re: Dead slow IDE
Post by: pert on May 29, 2019, 05:45 pm
After creating a portable folder within the IDE installation folder on C drive the IDE doesn't boot at all. You see the IDE pops open for a moment and then disappears. 
You must have the Arduino IDE installed to the Program Files (x86) folder. Windows 10 is very restrictive of changes to that folder. When the Arduino IDE starts, it's trying to create a sketchbook folder under the portable folder but Windows blocks that folder creation, which causes the Arduino IDE startup to fail.
Title: Re: Dead slow IDE
Post by: ROVguy on May 31, 2019, 01:13 am
You must have the Arduino IDE installed to the Program Files (x86) folder.
Pert, You are correct I did have it saved in x86. After reading your comment I uninstalled and reinstalled the IDE just inside C:. The results is still the same
Title: Re: Dead slow IDE
Post by: pert on May 31, 2019, 01:19 am
I'm sorry to hear it didn't result in any improvement. Well at least the negative result tells us that accessing external folders is not the cause of the slowness. Unfortunately I'm out of ideas. The antivirus and the external folders are the only two potential causes of slowness I could think of. Hopefully someone else here will have another idea.
Title: Re: Dead slow IDE
Post by: DrAzzy on May 31, 2019, 01:25 am
Does turning off bluetooth change anything? I recall on one occasion, under conditions I don't remember, there was some issue with some IDE (maybe Arduino, maybe something else) being insanely slow because it was trying to enumerate bluetooth serial ports, and wound up waiting through a bluetooth device search timeout or something.
Title: Re: Dead slow IDE
Post by: flounder on May 31, 2019, 06:17 am
The correct place to create a working folder in Windows is NOT under the .exe directory, but in the AppData folder for the user.  This means that if you have two different people who can log into the computer, their Arduino working directories are separate.  Only amateurs create working directories under the .exe directory.

I built windows apps for over 25 years.  The problem is learning to not follow the mistakes of people who didn't know what they were doing when they did it, and adopt the methods that are guaranteed to work.
       joe
Title: Re: Dead slow IDE
Post by: pert on May 31, 2019, 06:36 am
The correct place to create a working folder in Windows is NOT under the .exe directory, but in the AppData folder for the user.
...which is exactly what the Arduino IDE does normally. However, there are some use cases where this is not convenient or not possible. For those use cases, there is portable mode.
Title: Re: Dead slow IDE
Post by: ballscrewbob on May 31, 2019, 04:04 pm
There are a few posts about slow IDE conditions.

There are also a few differing solutions worth investigating.
Some involve computers security in regards to antivirus and such and others involve JAVA versions.

Would suggest using the search option to find them and read up a little more.

Bob.
Title: Re: Dead slow IDE
Post by: ROVguy on Jun 03, 2019, 01:49 pm
I'm sorry to hear it didn't result in any improvement. Well at least the negative result tells us that accessing external folders is not the cause of the slowness. Unfortunately I'm out of ideas. The antivirus and the external folders are the only two potential causes of slowness I could think of. Hopefully someone else here will have another idea.
Sorry, this actually did work! I did the change late and didn't add the portable folder. I finally had time to go through this again and noticed the missing folder. Once added things sped up.

Thanks
Title: Re: Dead slow IDE
Post by: pert on Jun 03, 2019, 04:00 pm
Great news! Now you could stick with portable mode or you can investigate further to try to find out how you can resolve the slowness issue when in non-portable mode. It's up to you.

When you are in non-portable mode, the Arduino IDE is accessing two external folders:
Sketchbook: The location is set in File > Preferences > Sketchbook location. When in portable mode, the default location of the sketchbook is {Arduino IDE installation folder}/portable/sketchbook. When in non-portable mode, the default location of the sketchbook is something like C:\Users\{user name}\Documents\Arduino, but it might be different if you have OneDrive enabled.
Data folder: When you are in portable mode this is located at {Arduino IDE installation folder}/portable. When in non-portable mode it is located at C:\Users\{user name}\AppData\Local\Arduino15.

So the next step in the investigation would be to determine which of those two folders were the cause of the slow down. The way you can do this is:


After doing that, there will likely be two possible results: If the Arduino IDE is still fast then you know that the problem is with the location of the data folder when not in portable mode. If the Arduino IDE is slow then you know the problem is with the location of the sketchbook folder you set in File > Preferences > Sketchbook location.
Title: Re: Dead slow IDE
Post by: ROVguy on Jun 09, 2019, 01:07 am
Well Pert. I was working on a new problem and decided to reinstall Arduino. While reinstalling it I followed flounder suggestion of installing it under  AppData. There I didn't need portable and everything seems to work just fine.

So again thanks to everyone that helped!
Title: Re: Dead slow IDE
Post by: henrygab on Jan 21, 2020, 08:51 am
Great news! Now you could stick with portable mode or you can investigate further to try to find out how you can resolve the slowness issue when in non-portable mode. It's up to you.
...
So the next step in the investigation would be to determine which of those two folders were the cause of the slow down.
...
After doing that, there will likely be two possible results: If the Arduino IDE is still fast then you know that the problem is with the location of the data folder when not in portable mode. If the Arduino IDE is slow then you know the problem is with the location of the sketchbook folder you set in File > Preferences > Sketchbook location.
Hi @pert,

I have had this problem with GUI, and following these instructions, it is clearly due to the GUI enumerating all files/folders under the sketch directory.  Here's the evidence:

After setting the portable mode's sketchbook preference via the GUI, I could not close the app for quite a while.  Restarting in portable mode with my sketchbook directory still showed this really long startup time.

Moreover, setting the non-portable to a different directory (with no files) made startup quite fast.

The key proof, however, was watching the javaw.exe process using SysInternals' Process Monitor.  ProcMon showed that the entire directory tree was being enumerated(!), before any UI was shown.


BUG TITLE:
Arduino GUI startup blocked while enumerating entire sketchbook directory

STEPS TO REPRO:
Have a sketchbook directory with many, many files.
e.g., multiple BSPs under subdirectory 'hardware', multiple libraries under subdirectory 'library', multiple other directories containing depots from different organizations.  The BSPs are likely the easiest to do this with.

Example:


NOTE: It appears that BSPs must be in subdirectory 'hardware' of the sketchbook. ... they are not found if in parent directories...











Title: Re: Dead slow IDE
Post by: pert on Jan 21, 2020, 02:57 pm
Thanks for taking the time to share your findings @henrygab.

Did you notice this had an effect on compilation time also?

The enumeration of the packages, sketches, and libraries in the sketch folder on startup is expected, because the Arduino IDE must do this to populate the File > Sketchbook, File > Examples, Sketch > Include Libraries, and Tools > Boards menus. Perhaps the scan could be optimized to be faster, but there is no way to avoid it altogether. When compiling the sketch, it will need to scan the active board's package as well as the libraries in order to find the sketch's dependencies, but it should not scan the sketches in the sketchbook.
Title: Re: Dead slow IDE
Post by: remadsenjr on Apr 14, 2020, 12:13 am
I recently had a problem on one Windows 10 machine with all versions of the Arduino IDE (including the newest, 1.8.12) being extremely slow to start up and, more importantly, extremely slow to save any source code file. I traced the problem to the "preferences.txt" file. Within that file, there was one section entitled, "recent-sketches". It included references to several dozen .ino files that I had worked on over the past 2 years. Some of these references were to files on my Western Digital network drive. A couple of weeks ago, I had to change the base IP address on my wireless router to eliminate a conflict with another piece of hardware on the same network. Unfortunately, the recent-sketches paragraph contained several explicit references to the old wireless router address, and that proved to be the cause of the terrible delays in starting the Arduino IDE and saving files. I solved this problem by deleting the entire recent-sketches paragraph, forcing the IDE to stop looking for files at the old WiFi address. NOTE: you must NOT be running the IDE when you delete the recent-sketches paragraph from the "preferences.txt" file. If the IDE is active, it will write the original content back to disk when you exit, eliminating all your edits. It would be good if the Arduino developers could add a diagnostic mode to the IDE that allows the user to see exactly what the IDE is trying to do behind the scenes, such as repeatedly trying to access a network drive using an old address. Even better, if while processing the recent-sketches paragraph it is determined that a referenced drive is not accessible, have the IDE ask the user if they want to REMOVE the references to that drive so the problem does not keep occurring, leaving people like me to spend 7 hours trying to guess why.
Title: Re: Dead slow IDE
Post by: ballscrewbob on Apr 14, 2020, 12:44 am
There is a DEBUG version of the IDE in the same folder as the IDE.

Yours is also another good reason not to use netweoked drives and shares or cloud based solutions unless you know what you are doing (which you seem to do)