/DisasmDemo.csproj Secret
Last active
April 9, 2018 12:39
BenchmarkDotNet v0.10.14 DisassemblyDiagnoser Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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