4 ms·
Ask HN: Why does VSCode fully drain MacBook Pro (M2) battery in 2hrs?
- nomilk 3y agoAccording to 9to5mac [1], my 2023 16" MBP should have around 14 hours of "wireless web battery". Today it lasted 2 hours flat. I had around 5 smallish files open in vscode and wasn't doing anything at all interesting or intensive (no docker, no automated testing, just writing code, and pretty slowly, frankly). [1] https://9to5mac.com/2023/10/30/m3-macbook-pro-battery-life/ https://9to5mac.com/2023/10/30/m3-macbook-pro-battery-life/
- FBISurveillance 3y agoI suggest you to check your extensions. Local LLMs, language server bugs, maybe even a compromised extension that mines crypto?
- nomilk 3y agoOn your suggestion, I tried `code --list-extensions` and got the list (working my way through them now to see if I can spot anything suspect): akamud.vscode-theme-onedark aliariff.vscode-erb-beautify esbenp.prettier-vscode github.copilot github.copilot-chat ibm.output-colorizer kaiwood.endwise ms-azuretools.vscode-docker ms-python.debugpy ms-python.isort ms-python.python ms-python.vscode-pylance ms-toolsai.jupyter ms-toolsai.jupyter-keymap ms-toolsai.jupyter-renderers ms-toolsai.vscode-jupyter-cell-tags ms-toolsai.vscode-jupyter-slideshow ms-vscode-remote.remote-containers ms-vscode.cmake-tools$\n ms-vscode.cpptools ms-vscode.cpptools-extension-pack ms-vscode.cpptools-themes ms-vscode.makefile-tools pkief.material-icon-theme reditorsupport.r shopify.ruby-lsp twxs.cmake vincaslt.highlight-matching-tag vscodevim.vim
- jotaen 3y agoI’d probably try to disable them all, and see whether that has any effect in the activity monitor. If so, I’d turn them on one after the other to identify which one is the culprit.
- zer00eyz 3y agothe process explorer In vs code should give you what you need!
- watersb 3y agoExcellent! FWIW, here's the link to troubleshooting vs code performance issues from the project's GitHub Wiki: https://github.com/Microsoft/vscode/wiki/Performance-Issues https://github.com/Microsoft/vscode/wiki/Performance-Issues
- jotaen 3y agoThis is more like an Ask HN, isn’t it? https://news.ycombinator.com/showhn.html https://news.ycombinator.com/showhn.html
- nomilk 3y agoTitle updated. ty.
- nomilk 3y agoFWIW, I rebooted and VSCode's energy usage is back to normal (less than 1/10th of what it was while it was consuming extremely high amounts of energy). https://imgur.com/rFXkoin https://imgur.com/rFXkoin
- animuchan 3y agoI second the "check the extensions" answer, because for me it sure doesn't — when working from home, I only charge a similar machine (M2 MBP) at night, so it's good for at least 9 hours of work, where work == VS Code + Slack + Zoom.