Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Why does VSCode fully drain MacBook Pro (M2) battery in 2hrs? (imgur.com)
4 points by nomilk 48 days ago | hide | past | favorite | 10 comments



I 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.


This is more like an Ask HN, isn’t it?

https://news.ycombinator.com/showhn.html


Title updated. ty.


I suggest you to check your extensions. Local LLMs, language server bugs, maybe even a compromised extension that mines crypto?


On 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


I’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.


the process explorer In vs code should give you what you need!


Excellent!

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


FWIW, 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


According 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/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: