microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.61k stars 29.03k forks source link

Battery consumption #203253

Closed abushka110 closed 8 months ago

abushka110 commented 9 months ago

Type: Performance Issue

I started using VS Code more often a few weeks ago. Recently, noticed that my laptop started to run out of power faster. The Activity Monitor shows that the biggest power consumption comes from VS Code, although what I'm doing doesn't use a lot of resources. Every day I use VS Code for about an hour or less, using the code editor to solve HackerRank problems, use Terminal and sometimes Copilot Chat. I usually don't close VS Code completely after finishing work. In Activity Monitor, it's more than 70% of battery in the last 12 hours taken by VS Code. Tried to find solutions on the web, nothing helped

VS Code version: Code 1.85.2 (Universal) (8b3775030ed1a69b13e4f4c628c612102e30a681, 2024-01-18T06:40:32.531Z) OS version: Darwin arm64 23.2.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M2 (8 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|2, 2, 2| |Memory (System)|8.00GB (0.31GB free)| |Process Argv|--crash-reporter-id f1779427-c3e3-4cb2-b3d5-2734d514e4b3| |Screen Reader|no| |VM|0%|
Process Info ``` CPU % Mem MB PID Process 49 164 48161 code main 0 66 48164 gpu-process 0 25 48165 utility-network-service 2 213 48167 window [1] (Untitled-1) 0 74 48182 shared-process 0 0 48294 /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= 0 41 48183 fileWatcher [1] 0 82 48184 extensionHost [1] 0 33 48209 electron-nodejs (/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=48184) 0 98 48287 window [2] (Issue Reporter) ```
Workspace Info ``` ; ```
Extensions (14) Extension|Author (truncated)|Version ---|---|--- gitlens|eam|14.7.0 code-runner|for|0.12.1 copilot|Git|1.153.0 copilot-chat|Git|0.11.1 material-icon-theme|PKi|4.33.0 java|red|1.26.0 vscode-multiclip|sle|0.1.5 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.2.30 vscode-java-debug|vsc|0.55.0 vscode-java-dependency|vsc|0.23.3 vscode-java-pack|vsc|0.25.15 vscode-java-test|vsc|0.40.1 vscode-maven|vsc|0.43.0
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:30899288 vsclangdc:30486549 c4g48928:30535728 azure-dev_surveyone:30548225 vscrp:30673768 2i9eh265:30646982 0bi6i642:30933247 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 ```
aiday-mar commented 9 months ago

I believe @jrieken is mainly in charge of performance. I was wondering if you know if there are steps a user can take to memory and power consumption of VS Code?

jrieken commented 9 months ago

/needsMoreInfo

Please use this guide to provide more information: https://github.com/Microsoft/vscode/wiki/Performance-Issues. Thanks.

vscodenpa commented 9 months ago

Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.

Happy Coding!

abushka110 commented 8 months ago

Was my mistake. Sorry