Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Visual Studio always uses significant energy when doing Go development #698

Closed
egamma opened this issue Dec 25, 2016 · 18 comments
Closed

Visual Studio always uses significant energy when doing Go development #698

egamma opened this issue Dec 25, 2016 · 18 comments
Assignees
Labels

Comments

@egamma
Copy link
Member

egamma commented Dec 25, 2016

From @thewhitetulip on December 9, 2016 8:33

  • VSCode Version: Code 1.7.1 (02611b40b24c9df2726ad8b33f5ef5f67ac30b44, 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.

Copied from original issue: microsoft/vscode#16963

@egamma
Copy link
Member Author

egamma commented Dec 25, 2016

From @strrchr on December 9, 2016 14:5

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

@egamma
Copy link
Member Author

egamma commented Dec 25, 2016

From @thewhitetulip on December 10, 2016 4:55

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!

@egamma
Copy link
Member Author

egamma commented Dec 25, 2016

From @kieferrm on December 13, 2016 6:0

//cc @egamma

@egamma
Copy link
Member Author

egamma commented Dec 25, 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
Copy link
Member Author

egamma commented Dec 25, 2016

From @thewhitetulip on December 23, 2016 4:41

@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

@egamma
Copy link
Member Author

egamma commented Dec 25, 2016

From @thewhitetulip on December 25, 2016 7:15

@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 Author

egamma commented Dec 25, 2016

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

@egamma egamma changed the title Visual Studio always uses significant energy Visual Studio always uses significant energy when doing Go development Dec 25, 2016
@ramya-rao-a
Copy link
Contributor

@thewhitetulip @strrchr Did you recently upgrade to Mac OS X Sierra?

There is a known issue of performance of Go tools on Mac OS X Sierra. See #503

Run the command Go: Install Tools. That should update all the go tools that the extension depends on which should fix the issue

@thewhitetulip
Copy link

It is about excess Energy being used and not CPU, I am not sure if this is the issue. I am using Sierra and will check after installing new binaries.

@ramya-rao-a
Copy link
Contributor

@thewhitetulip @strrchr Any updates?

@thewhitetulip
Copy link

@ramya-rao-a I am sorry, I was on a vacation, will reply back in 12hrs

@mattetti
Copy link
Contributor

@ramya-rao-a on a related note, we are spawning a new process for every hover. One option would be to switch gocode for something else, another would be to implement the gocode RPC client in TS and therefore run the query from within the extension. I have to admit that I don't know the energy cost of starting a new process on Windows and Mac so I can't tell if that would even help.

One thing I know, is that the battery life on my MBP 2016 is a joke and anything that would help me get more unplugged coding hours out of this machine would be welcome.

@thewhitetulip
Copy link

@mattetti I have a MBP 2012, 8hrs+ battery when I don't use VSCode, I still haven't gotten time to download and test the new binaries, I would love to use VSCode if it took equal or a little bit more energy than vi.

@mattetti
Copy link
Contributor

@thewhitetulip VSCodeGo and VimGo use basically the same tools under the hood so the difference might be with electron rendering. In my experience the CPU usage wasn't bad at all so I didn't notice anything specific to VSCode ( I switched from macvim). CPU is usually the driver or energy consumption. It would be interesting to get more metrics about where "energy" is used when you code with VSCode and if it's related to VSCode or the go extension.

@thewhitetulip
Copy link

thewhitetulip commented Jan 10, 2017

@mattetti Well, when I write Go using VSCode, then after five minutes, it pops up in "apps that use significant energy". I tried with Python, but it seems that Go extension is causing this issue. But even if this isn't the case, surely due to electron rendering vi still rocks.

If you give me specific information which you require, I'd be happy to give them. I Love VSCode, but my MBP runs only for 4hrs max if I use it, I didn't buy a MBP for running it for 4hrs! I want the full 8hrs!

@ramya-rao-a
Copy link
Contributor

@thewhitetulip Now that you see similar energy issues when the Go extension is disabled and the related issue in vscode is tracking the same, is it ok if we close this issue?

The other concern about hover spawning a new shell everytime is being tracked in other issues.

@thewhitetulip
Copy link

thewhitetulip commented Feb 7, 2017

@ramya-rao-a Yes, I feel it is appropriate to close this issue since we have established that energy is being used without this extension. I must say (again), I love how you guys(MS) are handling this project, fabulous! Not in my wildest dream had I thought that MS would change the way devs write code on Linux!

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Feb 7, 2017

Thanks for the kind words @thewhitetulip! We will keep working on that :) Happy Coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 23, 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

4 participants