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

High CPU usage when opening any file #2176

Closed
rebornix opened this issue Nov 27, 2017 · 7 comments
Closed

High CPU usage when opening any file #2176

rebornix opened this issue Nov 27, 2017 · 7 comments
Assignees

Comments

@rebornix
Copy link
Member

From @dqw on November 24, 2017 3:31

  • VSCode Version: Code 1.18.1 (929bacba01ef658b873545e26034d1a8067445e9, 2017-11-16T18:32:36.023Z)
  • OS Version: Windows_NT x64 10.0.15063
  • Extensions:
Extension Author (truncated) Version
html-snippets abu 0.1.0
Bookmarks ale 0.18.0
beautify Hoo 1.1.1
intellij-idea-keybindings k-- 0.2.16
Go luk 0.6.67
vscode-icons rob 7.18.1
vim vsc 0.10.5

Steps to Reproduce:

1.Open any file,the CPU usage over 75%
2.Close all file, the CPU usage down to 10%
3.@rebornix When I disabled vim extension,the problem solved

Reproduces without extensions: No
1
4
2
3

Copied from original issue: microsoft/vscode#39074

@mrsimo
Copy link

mrsimo commented Nov 29, 2017

I get the same behavior. With the vim extension enabled CPU spikes quite a lot, but only when an editor is open.

With a file open:

harvest_filename_cleaner rb harvestapp 2017-11-29 16-51-24

With an extension page open:

extension vim harvestapp 2017-11-29 16-50-27

In my case:

  • VSCode Version: 1.18.1
  • VsCodeVim Version: 0.10.5
  • OS: OSX 10.13.1

I'm pretty sure it started happening with the latest VSCode update. It's become very noticeable since.

@mrsimo
Copy link

mrsimo commented Nov 29, 2017

I'd like to mention that besides high CPU usage, working with VSCode gets quite slow. Keypresses get delayed and you need to wait before a word finishes typing.

@Chillee
Copy link
Member

Chillee commented Nov 29, 2017

@mrsimo I think there's an extension profiling thing. Could you try this and see if you see anything interesting?

https://code.visualstudio.com/docs/extensions/debugging-extensions#_profiling-your-extension

Also, does this replicate with all settings at default?

@Chillee Chillee mentioned this issue Nov 29, 2017
6 tasks
@mrsimo
Copy link

mrsimo commented Nov 29, 2017

Hey! The performance went back to normal with the Insiders build. Just tried that and with all my settings it's not causing any high CPU load.

Back to the standard VSCode, removing all my settings also seems to fix the issue. Curiously, if I apply them again, it doesn't increase the load. I need to stop VSCode and open it again (with my settings) for it to use high CPU. In case it helps, these are my settings: https://gist.github.com/mrsimo/4f54bd620c4fbfe9e7e90aa052c91909

I did the extension profiling thing, here's what it generated when recorded for about 10s: https://monosnap-albertllop.s3.amazonaws.com/CPU-20171129T202207.cpuprofile

Here's a screenshot of the top of another profile:

95a2c725-3e94-47aa-8a0f-1b90e0 2017-11-29 20-25-45

Cheers!

@jpoon
Copy link
Member

jpoon commented Nov 29, 2017

@mrsimo In your particularly case, this is likely the cause: https://gist.github.com/mrsimo/4f54bd620c4fbfe9e7e90aa052c91909#file-gistfile1-txt-L15.

See #2124

@mrsimo
Copy link

mrsimo commented Nov 29, 2017

Yes, that seems to be it. Thanks!

@dqw
Copy link

dqw commented Jan 26, 2018

The problem was resolved after updated to the latest version of vscode. This issue can be closed. Thanks. @rebornix

@jpoon jpoon closed this as completed Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants