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 allocations in AbstractSymbolCompletionProvider.CreateItems #74670

Conversation

ToddGrun
Copy link
Contributor

@ToddGrun ToddGrun commented Aug 6, 2024

The linq expression shows up as about 0.3% of allocations in the profile I'm looking for in the typing section of the scrolling speedometer test.

MultiDictionary has a struct-based value that is great for the case where the valueset typically is only a single object (which is the case for this code).

*** Relevant allocations from the profile I'm looking at ***
image

The linq expression shows up as about 0.3% of allocations in the profile I'm looking for in the typing section of the scrolling speedometer test.

MultiDictionary has a struct-based value that is great for the case where the valueset typically is only a single object (which is the case for this code).
@ToddGrun ToddGrun requested a review from a team as a code owner August 6, 2024 22:57
@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 6, 2024
@ToddGrun ToddGrun marked this pull request as draft August 7, 2024 01:54
@ToddGrun
Copy link
Contributor Author

ToddGrun commented Aug 7, 2024

test failing because of SymbolAndSelectionInfo's Equals comparison not matching what was previously used in this context. Need to ponder.

@ToddGrun
Copy link
Contributor Author

ToddGrun commented Aug 7, 2024

test failing because of SymbolAndSelectionInfo's Equals comparison not matching what was previously used in this context. Need to ponder.

OK, hopefully fixed by adding a separate comparer.

@ToddGrun
Copy link
Contributor Author

ToddGrun commented Aug 8, 2024

@genlu -- ptal

/// <summary>
/// Alternative comparer to SymbolAndSelectionInfo's default which considers both the full symbol and preselect.
/// </summary>
protected sealed class SymbolReferenceEquivalenceComparer : IEqualityComparer<SymbolAndSelectionInfo>
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi Aug 8, 2024

Choose a reason for hiding this comment

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

Why protected? #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy/paste oopsie

@ToddGrun ToddGrun enabled auto-merge (squash) August 8, 2024 16:08
@ToddGrun ToddGrun merged commit 9682b84 into dotnet:main Aug 8, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Aug 8, 2024
@dibarbet dibarbet modified the milestones: Next, 17.12 P2 Aug 26, 2024
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 VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants