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

Modify SyntaxNodeExtensions.GetMembers to instead execute a given lambda over the collection. #74628

Merged

Conversation

ToddGrun
Copy link
Contributor

@ToddGrun ToddGrun commented Aug 1, 2024

The scrolling speedometer profile I'm looking at is showing 0.7% of allocations during it's typing phase as boxing of the struct enumerators previously returned from SyntaxNodeExtensions.GetMembers.

Instead, as there is only one caller of this method (CSharpSyntaxFacts.AppendMembers), I've changed the method to take in a lambda and have it do the enumeration over the members, invoking the callback on each.

*** relevant allocations from the typing scenario in the scrolling speedometer test ***
image

…bda over the collection.

The scrolling speedometer profile I'm looking at is showing 0.7% of allocations during it's typing phase as boxing of the struct enumerators previously returned from SyntaxNodeExtensions.GetMembers.

Instead, as there is only one caller of this method (CSharpSyntaxFacts.AppendMembers), I've changed the method to take in a lambda and have it do the enumeration over the members, invoking the callback on each.
@ToddGrun ToddGrun requested a review from a team as a code owner August 1, 2024 01:32
@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 1, 2024
@ToddGrun ToddGrun enabled auto-merge (squash) August 1, 2024 01:58
@ToddGrun ToddGrun merged commit 2e04da5 into dotnet:main Aug 1, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Aug 1, 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