Created
April 19, 2019 03:01
-
-
Save Zhentar/deb1afb9bc30ed2a82583a348729dc9f to your computer and use it in GitHub Desktop.
Revisions
-
Zhentar created this gist
Apr 19, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,67 @@ using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; namespace BDNTest { public class Program { public static void Main() => BenchmarkRunner.Run<OverheadTests>(); } [SimpleJob] public class OverheadTests { private int _field; [Benchmark] public void OneIncrement() { _field++; } [Benchmark] public void TwoIncrement() { _field++; _field++; } [Benchmark] public void ThreeIncrement() { _field++; _field++; _field++; } [Benchmark] public void FourIncrement() { _field++; _field++; _field++; _field++; } [Benchmark] public void FiveIncrement() { _field++; _field++; _field++; _field++; _field++; } [Benchmark] public void SixIncrement() { _field++; _field++; _field++; _field++; _field++; _field++; } } }