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

Reduce LOH allocations for SemanticToken classification in LSP #69496

Conversation

ToddGrun
Copy link
Contributor

LSP semantic classification classifies the whole document per call. This ends up with a large number of classifiedspans per call, enough so that the standard ArrayBuilder cache ends up throwing away it's values upon Free. Instead, use the Classifier's pooled list, as it doesn't have the size limit for it's cache.

This accounts for about 0.5% of LOH allocations in the devenv process in the customer profile that I'm looking at.

LSP semantic classification classifies the whole document per call. This ends up with a large number of classifiedspans per call, enough so that the standard ArrayBuilder cache ends up throwing away it's values upon Free. Instead, use the Classifier's pooled list, as it doesn't have the size limit for it's cache.

This accounts for about 0.5% of LOH allocations in the devenv process in the customer profile that I'm looking at.
@ToddGrun ToddGrun requested a review from a team as a code owner August 14, 2023 19:21
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 14, 2023
@ToddGrun ToddGrun merged commit 6547e21 into dotnet:main Aug 15, 2023
24 checks passed
@ghost ghost added this to the Next milestone Aug 15, 2023
@dibarbet dibarbet modified the milestones: Next, 17.8 P2 Aug 28, 2023
@ToddGrun ToddGrun linked an issue Sep 12, 2023 that may be closed by this pull request
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.

Reduce LOH allocations for SemanticToken classification in LSP
4 participants