-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
31 lines (24 loc) · 1.24 KB
/
Copy pathProgram.cs
File metadata and controls
31 lines (24 loc) · 1.24 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
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Exporters;
using BenchmarkDotNet.Exporters.Csv;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
using LinqSumProof.Benchmarks;
using LinqSumProof.Reporting;
ManualConfig config = ManualConfig.Create(DefaultConfig.Instance)
.AddExporter(MarkdownExporter.GitHub)
.AddExporter(HtmlExporter.Default)
.AddExporter(CsvExporter.Default);
Type[] benchTypes = args.Length > 0 && args[0] == "width"
? [typeof(LinqSumWidthBench)]
: [typeof(LinqSumBench), typeof(LinqSumWidthBench)];
Summary[] summaries = BenchmarkRunner.Run(benchTypes, config);
// dotnet run -c Release -f net10.0 - полный прогон
// dotnet run -c Release -f net10.0 -- width - только WidthBench, минуты
List<Row> rows = BenchmarkResultCollector.Collect(summaries);
string resultsDir = BenchmarkResultCollector.GetResultsDirectory(summaries);
string recapPath = RecapReport.WriteAndPrint(rows, resultsDir);
string chartsPath = ChartsReport.Write(rows, resultsDir);
Console.WriteLine($"Сводка: {recapPath}");
Console.WriteLine($"Графики: {chartsPath}");
Console.WriteLine($"Таблицы: {resultsDir} (*-report-github.md - готовые для статьи)");