Skip to content

Performance Regression: GetCustomAttributes() Allocations Increased from netcoreapp2.1 #11637

@NickCraver

Description

@NickCraver

I'm not sure how much time I'll have to dig here, so filing an issue up front:
Allocations have increased and performance has regressed on certain Attribute paths sometime between netcoreapp2.1 (2.1.6) and netcoreapp3.0. I was adding the benchmark set I created for dotnet/coreclr#20779 and dotnet/coreclr#20795 to the new dotnet/performance repo in dotnet/performance#177 and too illustrate the utility, I was getting a screenshot for a tweet and...hey I found regressions. So this whole dotnet/performance thing is already paying off!

Here's a run comparing net472, netcoreapp2.1 (2.1.6) and netcoreapp3.0 (3.0.0-preview-27122-01 specifically):
image

Note the performance and allocation regressions specifically in these 4 benchmarks:

To reproduce this, in the dotnet/performance repo:

C:\git\NickCraver\performance\src\benchmarks\micro (master)
λ dotnet run -c Release -f netcoreapp3.0 -- --runtimes netcoreapp2.1 netcoreapp3.0 --filter System.Reflection.Attributes.GetCustom*

You can see in the initial benchmarks of dotnet/coreclr#20779 that the regression predates that PR, but that's the only date bound I have at the moment - we'll need to dig into history here and see what happened. Luckily, benchmarks in dotnet/performance being used for regression testing should prevent this sort of thing in the future and that's awesome. Kudos to @adamsitnik for putting that together...I never would have seen this otherwise.

cc @benaadams @danmosemsft @jkotas @stephentoub

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions