mirror of
https://gitee.com/dotnetchina/MiniExcel.git
synced 2024-12-02 03:47:41 +08:00
44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
using BenchmarkDotNet.Columns;
|
|
using BenchmarkDotNet.Configs;
|
|
using BenchmarkDotNet.Diagnosers;
|
|
using BenchmarkDotNet.Exporters;
|
|
using BenchmarkDotNet.Exporters.Csv;
|
|
using BenchmarkDotNet.Jobs;
|
|
using BenchmarkDotNet.Loggers;
|
|
using BenchmarkDotNet.Order;
|
|
|
|
namespace MiniExcelLibs.Benchmarks
|
|
{
|
|
public class Config : ManualConfig
|
|
{
|
|
public const int Iterations = 3;
|
|
|
|
public Config()
|
|
{
|
|
AddLogger(ConsoleLogger.Default);
|
|
|
|
AddExporter(CsvExporter.Default);
|
|
AddExporter(MarkdownExporter.GitHub);
|
|
AddExporter(HtmlExporter.Default);
|
|
|
|
var md = MemoryDiagnoser.Default;
|
|
AddDiagnoser(md);
|
|
AddColumn(TargetMethodColumn.Method);
|
|
AddColumn(StatisticColumn.Mean);
|
|
AddColumn(StatisticColumn.StdDev);
|
|
AddColumn(StatisticColumn.Error);
|
|
AddColumn(BaselineRatioColumn.RatioMean);
|
|
AddColumnProvider(DefaultColumnProviders.Metrics);
|
|
|
|
AddJob(Job.ShortRun
|
|
.WithLaunchCount(1)
|
|
.WithWarmupCount(2)
|
|
.WithUnrollFactor(Iterations)
|
|
.WithIterationCount(3)
|
|
);
|
|
Orderer = new DefaultOrderer(SummaryOrderPolicy.FastestToSlowest);
|
|
Options |= ConfigOptions.JoinSummary;
|
|
}
|
|
}
|
|
}
|