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

Switch PatternMatcher to use a TemporaryArray instead of ArrayBuilder. #69784

Conversation

ToddGrun
Copy link
Contributor

@ToddGrun ToddGrun commented Aug 31, 2023

The customer completion profile that I'm looking at shows 5.6% of allocations and 2.1% of CPU in VS during the completion request period are due to allocations in ArrayBuilder.AllocateSlow.

Simple testing on my machine shows > 20,000 roughly concurrent calls to TryUpperCaseCamelCaseMatch, only six of which end up with a non-empty matchedSpans (of size 2 in my test scenario). Instead of hitting some allocations in ArrayBuilder due to such heavy concurrent usage, instead just TemporaryArray which uses stack space for the common case of small arrays.

The customer completion profile that I'm looking at shows 5.6% of allocations and 0.7% of CPU in VS during the completion request period are due to allocations in ArrayBuilder.AllocateSlow.

Simple testing on my machine shows > 20,000 roughly concurrent calls to TryUpperCaseCamelCaseMatch, only six of which end up with a non-empty matchedSpans (of size 2 in my test scenario). Instead of hitting some allocations in ArrayBuilder due to such heavy concurrent usage, instead just TemporaryArray which uses stack space for the common case of small arrays.
@ToddGrun ToddGrun requested a review from a team as a code owner August 31, 2023 18:45
@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 31, 2023
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.

Switch PatternMatcher to use a TemporaryArray instead of ArrayBuilder.
4 participants