How I can see BenchmarkDotNet Diagnoser results in Visual Studio?

23 Views Asked by At

There was a recent post for VS 17.8 updates touting this behavior but I'm unable to see the 'Benchmarks' tab that is visible in the video.

I'm currently running Visual Studio Community 17.8.358.

Below is the (rather simple) Benchmark I'm running. I'm running it by going to `Debug -> Performance Profiler', selecting some benchmark (e.g. CPU Usage) and having it run. It runs the benchmark in Release which is as expected but it doesn't display the BenchmarkDotNet results.

using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Running;

namespace MyBenchmarks;

public class Foo
{

}

public class Foo<T> where T : Bar
{

}

public class Bar
{

}

[MemoryDiagnoser]
public class SpecificActivatorVsNew
{
    [Benchmark]
    public object ActivatorCreateInstance() => Activator.CreateInstance(typeof(Foo));

    [Benchmark]
    public object NewOperator() => new Foo();

}

public class Program
{
    public static void Main(string[] args)
    {
        BenchmarkRunner.Run<SpecificActivatorVsNew>();
    }
}
0

There are 0 best solutions below