-
Notifications
You must be signed in to change notification settings - Fork 1
/
Set.cs
37 lines (32 loc) · 1002 Bytes
/
Set.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 System.Collections.Immutable;
using BenchmarkDotNet.Attributes;
namespace Atropos.Benchmarks.Dictionary
{
public class SetIntString : PreInitedDictionaryBaseIntString<IImmutableDictionary<int, string>>
{
[Benchmark]
public override IImmutableDictionary<int, string> Atropos()
{
var a = _A;
for(var i = 0; i<Repetitions;i++)
a = a.SetItem(i, (i+1).ToString());
return a;
}
[Benchmark]
public override IImmutableDictionary<int, string> Official()
{
var c = _C;
for (var i = 0; i < Repetitions; i++)
c = c.SetItem(i, (i + 1).ToString());
return c;
}
[Benchmark]
public override IImmutableDictionary<int, string> Tunnel()
{
var t = _T;
for (var i = 0; i < Repetitions; i++)
t = t.SetItem(i, (i + 1).ToString());
return t;
}
}
}