-
-
Save AndreyAkinshin/62d2f4c3e67acde844f569fbf5846570 to your computer and use it in GitHub Desktop.
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