Skip to content

Instantly share code, notes, and snippets.

@AndreyAkinshin
Last active April 9, 2018 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreyAkinshin/62d2f4c3e67acde844f569fbf5846570 to your computer and use it in GitHub Desktop.
Save AndreyAkinshin/62d2f4c3e67acde844f569fbf5846570 to your computer and use it in GitHub Desktop.
BenchmarkDotNet v0.10.14 DisassemblyDiagnoser Demo
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.10.14" />
</ItemGroup>
</Project>
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Jobs;
using BenchmarkDotNet.Environments;
using BenchmarkDotNet.Running;
namespace DisasmDemo
{
[DryCoreJob, DryMonoJob, DryClrJob(Platform.X86)]
[DisassemblyDiagnoser]
public class IntroDisasm
{
[Benchmark]
public double Sum()
{
double res = 0;
for (int i = 0; i < 64; i++)
res += i;
return res;
}
}
class Program
{
static void Main() => BenchmarkRunner.Run<IntroDisasm>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment