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 TypeSymbolExtensions.IsAtLeastAsVisibleAs #75401

Merged

Conversation

ToddGrun
Copy link
Contributor

@ToddGrun ToddGrun commented Oct 4, 2024

This method showed up in multiple profiles as about 0.6% of allocations in the Roslyn CA process in the csharp editing speedometer test.

This simply avoids those allocations by switching to a static lambda using the arg data to pass in a pooled object. Note that the arg passed into VisitType needed to be a class to allow the ref parameter to change it's value.

*** old allocations ***
image

This method showed up in multiple profiles as about 0.6% of allocations in the Roslyn CA process in the csharp editing speedometer test.

This simply avoids those allocations by switching to a static lambda using the arg data to pass in a pooled object. Note that the arg passed into VisitType needed to be a class to allow the ref parameter to change it's value.
@ToddGrun ToddGrun requested a review from a team as a code owner October 4, 2024 22:03
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 4, 2024
Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

LGTM (commit 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers 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.

5 participants