Today I downloaded the newest Arduino IDE 2.0
and tried to compile a sketch for ESP32.
The CPU-load jumped up to 100% just after loading it.
Then I started compiling CPU-load is between 75 and 100%.
There were three processes cc1plus.exe that occupy 60 to 75% of CPU-time.
How can I force The Ardiuno IDE 2.0 to reduce this to 10% per cc1plus.exe thread so
that all in all the IDE only takes a maximum of 30% of CPU-time.
If this is not possible all the new bells and whistles the new IDE offers are worthless to me
Hi @StefanL38. Are you seeing some impact from the amount of CPU the IDE is using?
For me, I would prefer all the available resources were used so that the process is finished as soon as possible. What is the point of having an extra 70% CPU capacity going unused?
As for your question, it seems to me this is something that would need to be configured at the operating system level. The operating system should be responsible for the management of resources.
If you're using Windows 10, open the task manager (ctrl-alt-delete, select task manager), select the "details" tab, and you can set "affinity" for any task you want from a right click menu on what you select that will disallow the task to run on specific cores. For example, you could limit it to the last 3 of 8 cores, which is about 36%. Or 1 of 4 cores for 25%.
Alternatively you can drop the task priority from "normal" to "below normal" so that other things will preempt it. Or make other task you are worried about getting "blocked" a higher priority.
If you don't have windows, I cannot be of any help.
I don’t use IDE2. But first time compilation always takes the longest, there is no way around. In my case I switched off deep library search and included all necessary headers explicitly as well as excluding project from anti-virus check.
I want to force it down to a level that leaves room for other things.
The IDE 1.8.19 is using a lot CPU-load too but the difference to IDe 2.0 is
IDE 2.0 occupies so much CPU-time that my PC becomes unresponsive in general
with IDE 1.8.19 i never encountered performance-problems like with IDE 2.0
waiting 5 seconds for the reaction of a simple mouse-click
Here the IDE 2.0 has a very egoistic manner grab ALL you can get.
I'm using a lot of non-standard software including 3 different 3D-CAD applications
but none of these software causes the mouse to hang except IDE 2.0.
ZIP programs even offer limit CPU-load to x%
So in general it must be possible to limit the CPU-load a program causes.
So there should be an option
The IDE 2.0 is known for causing perfomance-problems in the past. The main part of these problems seemed to be solved. I would apreciate it if an option "limit CPU load to x% would be added
the hint about process-priority and core-affinity is very good.
I googled how changing priority / affinity can be changed automatically and found these two sites
How to write a powershell-script to change priority and core-affinity
how to change execution-policy to allow running powershell scripts
I made some tests how long does it take on my
X1-Tablet-16-2
Prozessor Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz 1.61 GHz
RAM 16,0 GB
to compile a sketch for ESP32 wich uses quite some libraries.
First compile Priority low 1 of 4 cores 1:55 Total CPU-Load of everything 50-70%
second compile Priority low 1 of 4 cores 1:22 Total CPU-Load of everything 50-70%
First compile Priority normal 4 of 4 cores 1:40 Total CPU-Load of everything 60-100%
second compile Priority normal 4 of 4 cores 1:25 Total CPU-Load of everything 60-100%
So the performance difference is not that much
I wrote this powershell-script to switch priority to low and affinity to core 0
This script must be executed each time the Arduino IDE 2.0 is started new
So next step is to automate running the script each time Arduino IDE 2.0 is started
this will need some research if this can be done by a batchfile or with autohotkey
Thanks for the clarification. The request definitely makes sense in this case where the usability of the system is compromised, rather than only trying to hit an arbitrary resource usage number.
I'm sorry to hear that the performance issue was not resolved for you. This is unexpected because the previously reported issues seemed to be resolved for everyone else by the work that was done this summer. As you recall, we had a steady stream of reports of this type of problem from the users, which cut off as soon as the last round of work was completed.
Yes but then the script has to wait until most of the exe-files have started.
I'm not familiar with the powershell-scripting language how to do this waiting.
The existing script is based on find the processes. If a process isn't started yet the script won't find the process
Respectfully, this is a very wrong view for a PC; the OS has that responsibility: allocate resources among the various running threads.
For what you insist upon doing, install the IDE 2.x on a dedicated PC and use a remote window on your nice shinny PC that is running other important stuff. An old, adequate PC can be had for little fund$, often free. Remote is very efficient.
Alternately, if you have 8GB of RAM, you can easily run Linux under Windows and run Arduino IDE 2.x in the Linux session. This is extraordinary efficient and again you get a local terminal window into Linux and then you can start the x-server and connect from the Window side. Easy, efficient. The load in Linux is virtually unfelt on the Windows side... virtualization is that good.
Even a better reason to use virtualization. If you want full control, the technologies are available and they are light-weight. You owe it to yourself to take control of your computing environment; asking Arduino corporate to build tunable limits into the software is, in my optinon, not realistic.
Personally, I do not find this to be a surprise. The Op has his environment cluttered with what is described as:
From a software development PoV, integration testing would never match his environment - this is a one-off problem, IMO. Other users that are having "speed" concerns should consider what side-by-side apps that are running and if you are programming, can you unload those apps? Even with ample RAM of 4G, running multiple heavy-hitters like graphics and 3D can cause RAM starvation and the OS can start swapping. Even nice 8G PCs sometimes go cheap and use slow-rotation conventional hard disks.
Any single PC must perform across a range of applications, so essentially there is no application tuning. That dedicated, network attached Arduino box looks like the simplest solution: also can serve as a backup of one's source code or a roll-back during development.