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

Pause a short while before computing if fixes or refactorings are available at a particular line #73755

Merged
merged 1 commit into from
May 29, 2024

Conversation

CyrusNajmabadi
Copy link
Member

This drops the CPU usage used while scrolling by 12%:

image

down to:

image

--

The call we are getting here is made from the editor to determine if they should show the lightbulb at all. While scrolling, we get this call every time the line changes. So we kick off the work instantly, then cancel it, then kick it off, then cancel it, over and over again.

This changes us to just not bother until a very short time has passed (100ms). This is slow enough that we don't even bother for almost all times. But fast enough that it's not noticeable, and actually moving to a line will show the lightbulb very quickly if you stop on it.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 28, 2024 23:39
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 28, 2024
@CyrusNajmabadi
Copy link
Member Author

Waiting on @kayle to ensure that this won't be a telemetry concern.

Kayle this is not the action of the user bringing UP the lightbulb. Rather, this is the code that runs when the editor determines if a lightbulb should be shown on a light, and what sort of lightbulb to show. will this have any issues with telemetry? like will thsi show as some massive regressions somewhere?

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge May 29, 2024 16:40
@CyrusNajmabadi CyrusNajmabadi requested a review from ToddGrun May 29, 2024 17:53
@CyrusNajmabadi
Copy link
Member Author

@ToddGrun ptal

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants