I recently started working with the Arduino IDE and have noticed that the IDE uses a lot of energy, heats my Mac, and has slowdowns. I understand any Electron app will be extremely unoptimized but this seems to be worse than any other Electron app I use.
I mostly use VSCode and have anywhere between 10 and 20 extensions running at a given time. In a given day my 12hr power will be about 500-700 units. Yesterday, I used the IDE for 3 hours straight (two windows open, consistent serial data coming in) and my 12hr power jumped to about 1000.
I have experienced general slowdowns where the scrolling becomes choppy to outright crashes. It appears the biggest cause of the slowdowns is the serial monitor.
Has anyone else experienced these slowdowns before? Is there other data I can give to paint a better picture?
Arduino Version
Version: 2.3.2
Date: 2024-02-20T09:53:59.281Z
CLI Version: 0.35.3
Copyright © 2024 Arduino SA
Mac Version
MacBook Pro 14-inch, 2023
Apple M2 Pro 16GB
I am running IDE 2.3,2 on an M2 MacBook Air w/16GB/Sonoma 14.4.1 and while I haven't noticed excessive energy usage it does creep along compared to IDE 1.8. Depending on the board installed and any particular protocol stacks used, compilation can take a long time and I usually use the time for a short task like a drink of water, etc.
I haven't experienced any choppy scrolling or crashes though.
Hi @CONTR0L .
This could be caused by specific unusual types of usage of Serial Monitor:
opened 07:45AM - 01 Apr 22 UTC
topic: code
type: imperfection
topic: serial monitor
### Describe the problem
If the Arduino board prints a large amount of data w… ithout a line break to Serial Monitor, the IDE becomes unresponsive.
### To reproduce
#### Equipment
- Any Arduino board
#### Steps
1. Upload the following sketch to the Arduino board:
```cpp
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.print("hello");
}
```
1. Open the "**Serial Monitor**" view.
1. Select "**115200 baud**" from the dropdown baud rate menu at the top right corner of the "**Serial Monitor**" view.
1. Wait a couple minutes.
**ⓘ** It will likely occur much sooner than that, especially with a board that has native USB capability
1. Try to use the Arduino IDE UI.
🐛 The UI is unresponsive.
### Expected behavior
Arduino IDE handles this condition gracefully.
That could even be a limit on the line length that will be displayed, since it is more likely that problematic line lengths would be caused by a missing line break in the sketch than intentionally formatting.
### Arduino IDE version
#### Original report
2.0.0-rc5-snapshot-c9b498f
#### Last verified with
2.0.0-rc5-snapshot-df8658e (was not fixed by https://github.com/arduino/arduino-ide/pull/982)
### Operating system
Windows
### Operating system version
10
### Additional context
There were similar reports of Serial Monitor impact on CPU performance, but those were resolved by https://github.com/arduino/arduino-ide/pull/524
- https://github.com/arduino/arduino-ide/issues/397
- https://github.com/arduino/arduino-ide/issues/519
#### Additional reports
- https://forum.arduino.cc/t/2-0-slows-down-if-very-long-lines-but-ok-with-crs-line-feeds-inserted/1021335
- https://forum.arduino.cc/t/ide-2-ver-2-1-wont-close-in-win10/1118105
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://github.com/arduino/arduino-ide#nightly-builds)
- [X] My report contains all necessary details
Does the problem still occur while you perform this experiment?:
Upload the following simple sketch to your Arduino board:void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println("hello");
delay(1000);
}
Open Serial Monitor.
Select "9600 " from the baud rate menu.
Close any other Arduino IDE windows that are open.
Hey @ptillisch
There aren't any slowdowns when running that code. Even when removing the delay.
The slowdowns appear to only happen after running the IDE for at least 45 minutes.
I wonder if there is some resource connected to the serial console that gradually eats up memory and doesn't free it, either intentionally or not.
One thing to note is when the IDE slows down and gets to a point where I have to force quit it, no other applications on my computer are affected.
Hope this helps.
Does it occur if you run Arduino IDE for at least 45 minutes while the connected board is running the simple test sketch I provided?
@CONTR0L
I am using MacBook 2014-2015
When I updated to 2.x.x, the IDE almost became unusable and would never finish updates/downloads/loading of things… i couldn’t even type of letter of code without my computer fan running full speed and cpu overheating…
I think there may be a known open issue and a fix coming down the line??
Not sure if this will help you but it helped me tremendously. I limit and only allow the IDE access to half of my cpu cores…
Add advanced setting to limit thread count of language server
arduino/arduino-ide#2350
, arduino/vscode-arduino-tools#46
, arduino/arduino-language-server#177
, arduino/arduino-language-server#176
Arduino IDE uses a language server to provide features such as autocomplete and "go to definition".
The language server must have an understanding of the complete sketch program, including its dependencies, and repeatedly update that information while the sketch is being edited. This requires a significant amount of processing, which can impact the performance of the user's computer under certain conditions.
It is now possible to configure the number of CPU cores Arduino IDE's language server is allowed to use. Most users should be fine with the default configuration, but in case you are affected by excessive CPU load while using Arduino IDE, you can adjust this setting by following these instructions:
Click for instructions
Press the Ctrl +Shift +P keyboard shortcut (Command +Shift +P for macOS users) to open the "Command Palette".
A menu will appear on the editor toolbar:
Select the "Preferences: Open Settings (UI) " command from the menu.
3.ⓘ * You can scroll down through the list of commands to find it or type the name in the field.
A "Preferences " tab will open in the Arduino IDE main panel.
Type arduino.language.asyncWorkers
in the "Search Settings " field of the "Preferences " tab.
Set the number of cores for the language server via the field under "Arduino › Language: Async Workers " setting.
Close the Preferences tab by clicking its X icon.
system
Closed
November 27, 2024, 10:57pm
7
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.