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
VSCode scroll up and down, high CPU usage is two times sublime #10289
Comments
Do you have any extensions installed or any settings (different than the default)? It would be helpful to see the CPU profile on your machine:
|
(When I do what you describe, on my Windows machine the CPU usage does not go above 9%) |
Also interesting that from your screenshot it looks like "Code Helper" is accounting for most of the CPU time. Does the same CPU usage occur when opening a new window (without opening a folder). I think it might be the file watcher... |
@alexandrudima I completely delete my vscode and all extensions. Then I fresh install vscode, use all default setting. You see, I just opened a single file, Then I start to scroll up and down. At the end of gif, the CPU usage upto 72%. If I continue scroll, the CPU usage will continue increase. |
The cpu profile file |
I looked at the cpu profile and it looks normal. When switching to a Chart view, you can examine the individual render calls and as far as I can tell, they are almost all below 10ms (with most of them probably around 5-6ms). So to render a frame we spend <10ms in our code, leaving a budget of 6ms to the browser to get those new dom nodes painted in order to get 60fps. In those 10ms we compute which new lines must be visible, render them (as dom nodes, with each different token in a different span), and add them to the DOM while removing the no longer visible lines. It is highly possible that the rendering code can be improved (e.g. remove class names on the dom nodes and compute immediately the colors needed for the text or other optimizations), but this issue in itself does not target such an improvement, therefore I am opting to close it. |
Thanks for your reply. I think this problem may have some relationship with OS X. Because when I use VIM's relative line-number, the scroll performance is also poor. But on Linux it's fine. |
Steps to Reproduce:
the code's CPU usage can upto 90+%
the same file in sublime and same scroll, only ~50%
the demo files
The text was updated successfully, but these errors were encountered: