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

New Code Lens Feature Trashes CPU On Scroll #963

Closed
thedillonb opened this issue May 4, 2017 · 4 comments
Closed

New Code Lens Feature Trashes CPU On Scroll #963

thedillonb opened this issue May 4, 2017 · 4 comments

Comments

@thedillonb
Copy link

thedillonb commented May 4, 2017

The new code lens feature, while awesome, is going to town on my CPU when simply scrolling through go files. The GURU process spawns and immediately eats into available CPU:

screen shot 2017-05-04 at 4 28 49 pm

This results in a choppy scroll experience and only subsides when left alone for a while. My only course of action to mitigate this is to add:

"[go]": {
        "editor.codeLens": false
    }

I am running on OSX 10.12.1 on the latest VS Code and VSCode-Go releases.

@ramya-rao-a
Copy link
Contributor

yes thats crazy, I assumed that VS Code will re-use the data while scrolling if there is no change to the document.

But looks like even a slight scrolling is resulting in vscode asking for references all over again.

I'll look into what options we have.

Thanks for reporting!

Meanwhile you can set go.referencesCodeLens.enabled to false to disable this.

@goenning
Copy link
Contributor

goenning commented May 4, 2017

What about disabling this feature by default and leave as experimental while it's not performing as expected? I guess it's causing more harm than good at the moment.

@ramya-rao-a
Copy link
Contributor

The issue was that a new codelens object was being returned after being resolved due to which the cached result was always getting invalidated.

With the commit above, the references will only be recalculated when there is change followed by scroll in the document.

This still may be expensive especially in Windows where guru is known to be slow.

Will consider disabling by default.

@ramya-rao-a
Copy link
Contributor

Alright, the perf issue while scrolling without making any change to the document is fixed.
References is disabled by default.
And the setting to use to enable it looks like this:

       "go.enableCodeLens": {
           "references": false,
           "runtest": true
       }

@thedillonb Do give it a try

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants