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

Remove allocations from IsCustomAttributeDefined #44694

Merged
merged 1 commit into from
Nov 15, 2020

Conversation

benaadams
Copy link
Member

@benaadams benaadams commented Nov 15, 2020

Rather than going via CustomAttributeData.GetCustomAttributeRecords and creating an array, iterate the attributeTokens directly.

Also has the advantage of early out rather than iterating every element to create the array then iterating it again for the test.

Startup allocations for ASP.NET MVC app

Before

image

After

image

Contributes to #44598

/cc @jkotas @stephentoub

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thank you

@jkotas jkotas merged commit 25260d1 into dotnet:master Nov 15, 2020
@benaadams benaadams deleted the IsCustomAttributeDefined branch November 15, 2020 03:41
@ghost ghost locked as resolved and limited conversation to collaborators Dec 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants