-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
48 lines (44 loc) · 1.57 KB
/
Program.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
38
39
40
41
42
43
44
45
46
47
48
using System;
namespace NMF.ExtensibilityBenchmark
{
class Program
{
static void Main(string[] args)
{
for (int j = 0; j < 50; j++)
{
var size = int.Parse(args[1]);
IBenchmarkRunner runner;
switch (args[0])
{
case "linkedList":
runner = new LinkedListBenchmarkRunner(42);
break;
case "collection":
runner = new CollectionBenchmarkRunner(42);
break;
case "collectionbatch":
runner = new CollectionBenchmarkRunnerBatch(42);
break;
case "linkedListbatch":
runner = new LinkedListBenchmarkRunnerBatch(42);
break;
case "recursiveCollection":
runner = new RecursiveCollectionBenchmarkRunner(42);
break;
default:
Console.Error.WriteLine("Unknown implementation");
return;
}
runner.Generate(size);
runner.Initialize();
var results = runner.Run();
for (int i = 0; i < results.Length; i++)
{
Console.WriteLine($"{args[0]};{size};{i};{results[i].Item1};{results[i].Item2},{Environment.WorkingSet}");
}
GC.Collect();
}
}
}
}