-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
65 lines (52 loc) · 1.36 KB
/
Copy pathProgram.cs
File metadata and controls
65 lines (52 loc) · 1.36 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System.Text;
using BenchmarkDotNet.Running;
using SortComparerProof;
using SortComparerProof.Benchmarks;
using SortComparerProof.Diagnostics;
Console.OutputEncoding = Encoding.UTF8;
if (args.Contains("allocations"))
{
Allocations.Print();
return 0;
}
if (args.Contains("sizes"))
{
Sizes.Print();
return 0;
}
if (args.Contains("checks"))
{
return Checks.Print() ? 0 : 1;
}
if (args.Contains("timing"))
{
Timing.Print();
return 0;
}
if (args.Contains("warmup"))
{
Warmup.Run();
return 0;
}
Type[] benchmarks =
[
typeof(SortIntBench),
typeof(SortItemBench),
typeof(BinarySearchBench),
];
BenchmarkConfig config = new();
BenchmarkSwitcher switcher = BenchmarkSwitcher.FromTypes(benchmarks);
if (args.Length > 0)
{
switcher.Run(args, config);
return 0;
}
switcher.RunAll(config);
return 0;
// Все замеры, сразу четыре рантайма: dotnet run -c Release -f net10.0
// Байты на вызов: dotnet run -c Release -f net10.0 -- allocations
// Из чего они: dotnet run -c Release -f net10.0 -- sizes
// Сверка ответов: dotnet run -c Release -f net10.0 -- checks
// Замер без BDN: dotnet run -c Release -f net10.0 -- timing
// Прогрев под дизасм: dotnet run -c Release -f net10.0 -- warmup
// Весь прогон: all.bat