-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
43 lines (36 loc) · 1.15 KB
/
Copy pathProgram.cs
File metadata and controls
43 lines (36 loc) · 1.15 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
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Exporters;
using BenchmarkDotNet.Exporters.Csv;
using BenchmarkDotNet.Running;
using RegexProof.Benchmarks;
using RegexProof.Diagnostics;
if (args.Contains("cold"))
{
Diagnostic.Run(args);
return;
}
ManualConfig config = ManualConfig.Create(DefaultConfig.Instance)
.AddExporter(MarkdownExporter.GitHub)
.AddExporter(HtmlExporter.Default)
.AddExporter(CsvExporter.Default);
Type[] benchmarks =
[
typeof(RegexBench),
typeof(RegexCreateBench),
typeof(RegexApiBench),
typeof(RegexCacheBench),
typeof(RegexScaleBench),
typeof(RegexBacktrackBench),
];
BenchmarkSwitcher switcher = BenchmarkSwitcher.FromTypes(benchmarks);
if (args.Length > 0)
{
switcher.Run(args, config);
return;
}
switcher.RunAll(config);
// Все замеры: dotnet run -c Release -f net10.0
// Один класс: dotnet run -c Release -f net10.0 -- --filter *RegexCreateBench*
// Первый вызов и память: cold.bat
// Исходник генератора лежит в папке Generated, его сохранение включено
// в RegexProof.csproj.