-
Notifications
You must be signed in to change notification settings - Fork 1
/
Index.cs
37 lines (33 loc) · 875 Bytes
/
Index.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using BenchmarkDotNet.Attributes;
namespace Atropos.Benchmarks.List
{
public class IndexInt : PreInitedBaseInt<int>
{
[Benchmark]
public override int Atropos()
{
var s = 0;
for (int i = 0; i < Repetitions; i++)
unchecked { s += _A[i % Size]; }
return s;
}
[Benchmark]
public override int Official()
{
var s = 0;
for (int i = 0; i < Repetitions; i++)
unchecked { s += _C[i % Size]; }
return s;
}
[Benchmark]
public override int Tunnel()
{
var s = 0;
for(int i=0; i<Repetitions;i++)
unchecked { s += _T[i % Size]; }
return s;
}
[Params(1000)]
public int Repetitions { get; set; } = 10;
}
}