Created
July 4, 2021 15:38
-
-
Save badamczewski/6da6b71dcb6fc25b1ba76f7afe411172 to your computer and use it in GitHub Desktop.
bench.cs
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 characters
public class Bench73 | |
{ | |
public int[] _a = new int[100_000]; | |
[Benchmark(Baseline = true)] | |
[MethodImpl(MethodImplOptions.NoInlining)] | |
public void A() | |
{ | |
for (int i = 0; i < 10000; i++) | |
_a[1] = 100; | |
} | |
[Benchmark()] | |
[MethodImpl(MethodImplOptions.NoInlining)] | |
public void B() | |
{ | |
for (int i = 0; i < 10000; i++) | |
_a[10000] = 100; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment