Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio always uses significant energy #16963

Closed
thewhitetulip opened this issue Dec 9, 2016 · 36 comments
Closed

Visual Studio always uses significant energy #16963

thewhitetulip opened this issue Dec 9, 2016 · 36 comments
Assignees
Labels

Comments

@thewhitetulip
Copy link

  • VSCode Version: Code 1.7.1 (02611b4, 2016-11-03T13:46:00.226Z)
  • OS Version: Darwin x64 16.1.0
  • Extensions:
Extension Author Version
beautify HookyQR 0.5.4
swift Kasik96 0.0.2
python donjayamanne 0.5.2
vscode-lua gccfeli 0.1.2
CSSfmt ilich8086 0.0.3
Go lukehoban 0.6.51
HTMLHint mkaufman 0.0.3
prettify-json mohsen1 0.0.3

Steps to Reproduce:

Open any file and do some changes, open the terminal or write Go code, vscode always consumes too much energy. This is the reason I have to use some light weight editor like Geany or vi. I'd love it if vscode uses less energy than what it does now.

@strrchr
Copy link

strrchr commented Dec 9, 2016

I encounter the similar problem.
Are there tips or options to reduce cpu usage?

@thewhitetulip
Copy link
Author

I started using vibecause despite the fact that this is an amazing text editor, it eats up my battery within 2-3hrs of usage. using vi, my battery stays four times upto 8hrs!

@kieferrm kieferrm added the perf label Dec 13, 2016
@kieferrm kieferrm added this to the Backlog milestone Dec 13, 2016
@kieferrm
Copy link
Member

//cc @egamma

@kieferrm kieferrm added the feature-request Request for new features or functionality label Dec 13, 2016
@bpasero bpasero removed the feature-request Request for new features or functionality label Dec 22, 2016
@egamma
Copy link
Member

egamma commented Dec 22, 2016

Open any file and do some changes, open the terminal or write Go code

The Go extension isn't shy to spawn new processes, e.g., on hover, which can result in increased energy consumption.

@thewhitetulip can you confirm that you only saw this problem when disabling the Go extension in the Extensions viewlet.

Assigning to @ramya-rao-a for further investigation in the Go extension. I'll add the caused by extension label for now.

@egamma egamma added the *caused-by-extension Issue identified to be caused by an extension label Dec 22, 2016
@thewhitetulip
Copy link
Author

@egamma Well, I use Code only for Go programming :-) So I can't say for sure. But I will confirm by writing a python project using VScode too

@thewhitetulip
Copy link
Author

@egamma I am sorry for the delay, yes, writing Go code marks VSCode as using high energy, tested thrice writing JS and writing Go, JS has no issues, Go has issues.

Also, thought you might want to know:

Code Helper eats 11% CPU for every single edit of any file (Go or not)
Code itself takes 1.4% CPU and 43MB when it is in background (it is updating to the new version, and has 1 open JS file)

92+28+26+59+23 MB is the system memory Code Helper eats even if it is idle (there are that many instances of the service) contrast that with iTerm, I had 10 tabs and a server running, still iTerm takes .4% CPU 43MB Memory

Do let me know if you need more information.

@egamma
Copy link
Member

egamma commented Dec 25, 2016

@thewhitetulip thanks for following up, I move the issue to the Go Issue repository for further investigation.

@egamma
Copy link
Member

egamma commented Dec 25, 2016

This issue was moved to microsoft/vscode-go#698

@egamma egamma closed this as completed Dec 25, 2016
@thewhitetulip
Copy link
Author

I am now editing a markdown book and VSCode is taking significant energy, I do not think it is because of the Go extension. @egamma @ramya-rao-a I just have the welcome screen on, not even a single document opened. I just updated every extension and the Go plugin's dependencies.

@egamma egamma added info-needed Issue requires more information from poster and removed *caused-by-extension Issue identified to be caused by an extension labels Feb 6, 2017
@egamma egamma assigned egamma and unassigned ramya-rao-a Feb 6, 2017
@egamma
Copy link
Member

egamma commented Feb 6, 2017

Reopening the issue

@thewhitetulip do you still observe the high energy consumption when you disable the extensions? To disable an extension pls see this doc

@thewhitetulip
Copy link
Author

@egamma I disabled all extensions permanently, I have my mac connected to wifi and Vscode is "using significant energy"

CPU consumed varies between 9% to 12% without extensions of any kind, with split window, one of markdown and another of a 100line python program
Energy impact is 12!!

5 processes costing me 240MB RAM @ramya-rao-a

@ramya-rao-a
Copy link
Contributor

@bpasero thoughts?

@bpasero
Copy link
Member

bpasero commented Feb 6, 2017

Maybe worth checking if a process is running with high CPU in that setup.

To find out more about this issue, we need to get at the process that is causing the high load. VS Code creates multiple processes, each with different tasks. Depending on your OS you can get at the full command line of the process and paste it here. On Mac, the Activity Monitor allows to find the PID of the process and from a terminal ps aux | grep <pid> reveals its arguments.

image

On Windows a tool like Process Explorer helps:

image

Once you have the information please update this issue with it. Thanks!

@thewhitetulip
Copy link
Author

I will do that, I would just like to know that am I the only one who is getting "significant energy usage"? I mean is there an issue with my mac(some weird local thing)?

@egamma
Copy link
Member

egamma commented Feb 7, 2017

@thewhitetulip we had some energy issues in the past, but most of them are closed by now.

@thewhitetulip
Copy link
Author

@egamma Yes, it takes somewhat CPU
wow, Code takes way less power on the Mac you are using, I am editing a markdown tutorial I am writing related to Python without any extension and this is the screenshot,
screen shot 2017-02-07 at 10 28 39 pm

@ramya-rao-a ramya-rao-a reopened this Feb 7, 2017
@bpasero
Copy link
Member

bpasero commented Feb 7, 2017

@thewhitetulip is there a constant 21.7% hit on the process or only when you type?

@chuckdries
Copy link

After reading through that other issue thread, running code with code --disable-extensions worked.

Now the thing is how to figure out which one(s) are the culprit.

It seems like this problem of runaway extensions is a common enough issue, perhaps a faq or documentation entry is in order. Maybe even a tool in vscode to tell which extensions are misbehaving?

@ramya-rao-a
Copy link
Contributor

@chuckdries You mentioned

"I've disabled every plugin and still my VSCode spins my fans all the way up.."

as well as

"running code with code --disable-extensions worked"

If both statements are true, then disabling extensions manually and running code with --disable-extensions are giving you 2 separate results. Can you confirm?

@chuckdries
Copy link

chuckdries commented Feb 24, 2017 via email

@rebornix rebornix marked this as a duplicate of #31375 Jul 25, 2017
@simonhaenisch
Copy link

simonhaenisch commented Sep 26, 2017

I'm having issues with this as well on a Mid-2010 MacBook Pro (which can switch between Intel HD Graphics and a NVIDIA GeForce GT 330M).

I launched code from the command line via

code --disable-extensions --disable-gpu

and it doesn't use much energy when in idle (jumping between 0.0 and 0.1), but in the activity monitor it still says that it requires the high performance GPU:

image

What exactly is the --disable-gpu flag supposed to do? The help text says:

Disable GPU hardware acceleration.

I know that Electron is based on Chromium and I'm quite sure that will already enable the high performance GPU on my Macbook (at least Chrome always needs it). Just might be helpful to have an info about what exactly that flag does, as I was expecting it to prevent using the high perf GPU for me.

Edit: Other Electron Apps like Slack, Atom and Whatsapp also need the high perf GPU.

@ramya-rao-a
Copy link
Contributor

cc @bpasero @jrieken

@vscodebot vscodebot bot closed this as completed Oct 4, 2017
@vscodebot
Copy link

vscodebot bot commented Oct 4, 2017

This issue has been closed automatically because it needs more information and has not had recent activity. Please refer to our guidelines for filing issues. Thank you for your contributions.

@thewhitetulip
Copy link
Author

@ramya-rao-a how did the bot close it? 😮

@ramya-rao-a
Copy link
Contributor

The bot closes issues with the label "needs-more-info" if there has been no additional info provided in the past 7 days.

I just went through the whole thread and here is the summary:

@ramya-rao-a ramya-rao-a reopened this Oct 12, 2017
@ramya-rao-a ramya-rao-a assigned bpasero and unassigned egamma Oct 12, 2017
@thewhitetulip
Copy link
Author

@ramya-rao-a Someone else posted a profile of their VSCode that is why I did not! Give me some time, I'll comment it as soon as I can.

@bpasero bpasero removed the info-needed Issue requires more information from poster label Nov 15, 2017
@bpasero bpasero removed this from the Backlog milestone Nov 15, 2017
@bpasero bpasero added the debt Code quality issues label Nov 23, 2017
@cvburgess
Copy link

screen shot 2018-01-03 at 12 23 52 pm

VSCode has been wrecking my macbook for the last two weeks or so... it can drain the battery in 2-3 hours on a new MBP. If there's anything I can do to help, please let me know!

@ramya-rao-a
Copy link
Contributor

@cvburgess Please log a new issue. Read through Performance Issues to see what you can share with us to help with your problem

@bonovski
Copy link

Well, vscode is unusable on battery because of code helper cpu usage even after vscode is fully closed. Multiple code helpers can still stay running after that and eat away your battery with high cpu usage.

The problem seems to be extension quality and integration into vscode or lack of.

Every time an extension crashes (and you mostly don't know since there is absolutely no message or alert, you just notice that something doesn't work) code helpers go crazy.

It's back to atom for me. Although it's slower it works without any annoying problems for me and my needs.

@bpasero bpasero removed the debt Code quality issues label Mar 7, 2018
@smxsm
Copy link

smxsm commented May 23, 2018

Yep, I can confirm that VSCode really sucks out the battery ... :( I have quite some extensions installed, so it'll be hard to find out which ones cause the major problems... what can we do?
There are also lots of nested CodeHelper Threads running, and you can see the high energy usage even compared to Chrome and Docker:

image

@ramya-rao-a
Copy link
Contributor

@smxsm Read through Performance Issues to see what you can share with us to help with your problem

@smxsm
Copy link

smxsm commented May 25, 2018

Hi @ramya-rao-a thanks for the performance debugging info - since I saw some indications in my status bar that the PHPCS extension was constantly checking files and I also saw in my process list that a LiveShare process was consuming lots of CPU I have disabled both extensions yesterday and now I am down from 80-90% battery usage for VSCode to approx. 20% :) I see if I can do some profiling later for the PHPCS extension.

@bpasero
Copy link
Member

bpasero commented Sep 10, 2018

I am closing this issue and ask to file individual issues to act on. Thanks for understanding.

@bpasero bpasero closed this as completed Sep 10, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests