Skip to content

Conversation

@stephentoub
Copy link
Member

This is showing up a bit on ASP.NET startup paths, and we can be more efficient (and simpler) in how we handle allocations and work.

As a microbenchmark, I tweaked TypeDescriptor.GetAttributes in both the original and PR bits to not cache attributes, so that the benchmark would simulate the impact on the first call per type. Then used it on types with no attributes, one attribute, and five identical attributes:

Method Toolchain Mean Ratio Allocated
None \master\corerun.exe 217.9 ns 1.00 272 B
None \pr\corerun.exe 195.6 ns 0.89 112 B
One \master\corerun.exe 491.9 ns 1.00 512 B
One \pr\corerun.exe 279.9 ns 0.80 360 B
Five \master\corerun.exe 396.6 ns 1.00 640 B
Five \pr\corerun.exe 375.5 ns 0.95 472 B

So, not a huge win, but the code gets simpler as well, and we remove one of the remaining dependencies on OrderedDictionary.

This is showing up a bit on ASP.NET startup paths, and we can be more efficient in how we handle allocations and work.
@stephentoub stephentoub added this to the 6.0.0 milestone Jan 26, 2021
@ghost
Copy link

ghost commented Jan 26, 2021

Tagging subscribers to this area: @safern
See info in area-owners.md if you want to be subscribed.

Issue Details

This is showing up a bit on ASP.NET startup paths, and we can be more efficient (and simpler) in how we handle allocations and work.

As a microbenchmark, I tweaked TypeDescriptor.GetAttributes in both the original and PR bits to not cache attributes, so that the benchmark would simulate the impact on the first call per type. Then used it on types with no attributes, one attribute, and five identical attributes:

Method Toolchain Mean Ratio Allocated
None \master\corerun.exe 217.9 ns 1.00 272 B
None \pr\corerun.exe 195.6 ns 0.89 112 B
One \master\corerun.exe 491.9 ns 1.00 512 B
One \pr\corerun.exe 279.9 ns 0.80 360 B
Five \master\corerun.exe 396.6 ns 1.00 640 B
Five \pr\corerun.exe 375.5 ns 0.95 472 B

So, not a huge win, but the code gets simpler as well, and we remove one of the remaining dependencies on OrderedDictionary.

Author: stephentoub
Assignees: -
Labels:

area-System.ComponentModel, tenet-performance

Milestone: 6.0.0

@stephentoub stephentoub merged commit 2e9d612 into dotnet:master Jan 30, 2021
@stephentoub stephentoub deleted the ordereddict branch January 30, 2021 01:06
@safern
Copy link
Member

safern commented Jan 30, 2021

Oops, it seems like there was no CI ran on this PR (I have no idea why), just noticed now by looking at the merge summary. Let's keep an eye on the rolling build to see if something breaks.

@MattGal @markwilkie who can we have take a look at why this happened?

@MattGal
Copy link
Member

MattGal commented Feb 1, 2021

Oops, it seems like there was no CI ran on this PR (I have no idea why), just noticed now by looking at the merge summary. Let's keep an eye on the rolling build to see if something breaks.

@MattGal @markwilkie who can we have take a look at why this happened?

Only Azure Devops can, and reading through their documents they would like you to report stuff like this via their public-facing developer community portal at https://developercommunity.visualstudio.com .

I filed https://developercommunity.visualstudio.com/content/problem/1326549/pr-checks-never-started-on-github-pr.html on your behalf here.

@safern
Copy link
Member

safern commented Feb 1, 2021

Thank you @MattGal, appreciate it 😄

@ghost ghost locked as resolved and limited conversation to collaborators Mar 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants