Skip to content

Move AspNetCoreBenchmarkAttribute to shared BenchmarkRunner.Sources #2975

@gfoidl

Description

@gfoidl

Background / Motivation

BenchmarkRunner.Sources contains common code for easily setting up benchmarks:

<ItemGroup>
 <Compile Include="..\..\shared\Microsoft.AspNetCore.BenchmarkRunner.Sources\**\*.cs">
   <Link>Shared\%(FileName)%(Extension)</Link>
 </Compile>
</ItemGroup>

So the benchmark-project just needs to add the intrinsically benchmark-code, for instance Microsoft.Extensions.Primitives.Performance.

Quite easy -- one may think...
When running the benchmarks I always get trapped by No loggers defined, you will not see any progress!.
It's because there needs to be added the AspNetCoreBenchmark at assembly-level (via AssemblyInfo.cs).

Proposal

To make the "setup" for benchmark-projects consistent with e.g. Program.cs this attribute should be moved to the shared sources, so no manual adding / copying of AssemblyInfo.cs is needed.

In aspnet/SignalR#1251 (comment) something similar was mentioned.

Affected projects

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions