Skip to content

Addition: Initial Benchmarks for System.Reflection: Attributes#177

Merged
adamsitnik merged 3 commits intodotnet:masterfrom
NickCraver:craver/attribute-tests
Dec 9, 2018
Merged

Addition: Initial Benchmarks for System.Reflection: Attributes#177
adamsitnik merged 3 commits intodotnet:masterfrom
NickCraver:craver/attribute-tests

Conversation

@NickCraver
Copy link
Member

This benchmarks specifically GetCustomAttributes() and IsDefined() paths (used in dotnet/coreclr#20779 and dotnet/coreclr#20795)

Note: there are many code paths through the attribute pipeline which vary drastically in terms of performance and allocations - so there's what seems to be an excessive number of benchmarks here, but they are all pretty unique.

Here's a sample run of the whole category on netcoreapp2.1:
image

The issue I can see here is naming. I tried to match conventions, but the descriptions are long because of the differentiation needed - is this okay? Suggestions for shortening them?

This benchmarks specifically GetCustomAttributes and IsDefined (used in dotnet/coreclr#20779 and dotnet/coreclr#20795)

Note: there are many code paths through the attribute pipeline which vary drastically in terms of performance and allocations - so there's what seems to be an excessive number of benchmarks here, but they are all pretty unique.
Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

@NickCraver big thanks for the PR! I am very happy to review the first benchmarks from our community!

Before I merge I would like to ask you for one thing:
could you please merge following partial classes:

src/benchmarks/micro/coreclr/System.Reflection/Attributes/AttributeTests.cs
src/benchmarks/micro/coreclr/System.Reflection/Attributes/GetCustomAttributes.cs
src/benchmarks/micro/coreclr/System.Reflection/Attributes/IsDefined.cs

into one:

src/benchmarks/micro/coreclr/System.Reflection/Attributes.cs

The namespace should be System.Reflection, the type name Attributes

once again big thanks for doing that!

PR feedback: don't follow the Math conventions here...go with what it should be :)
@NickCraver
Copy link
Member Author

Absolutely (and with pleasure) - FWIW I was following the conventions of the Math tests there (which I thought odd). Changes are in :)

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants