Cleanup benchmarks

This commit is contained in:
Alexey Golub
2020-02-04 19:45:33 +02:00
parent 4365ad457a
commit 896dd49eb4
2 changed files with 6 additions and 13 deletions

View File

@@ -1,6 +1,8 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Order; using BenchmarkDotNet.Order;
using BenchmarkDotNet.Running;
using CliFx.Benchmarks.Commands; using CliFx.Benchmarks.Commands;
using CommandLine; using CommandLine;
@@ -9,7 +11,7 @@ namespace CliFx.Benchmarks
[SimpleJob] [SimpleJob]
[RankColumn] [RankColumn]
[Orderer(SummaryOrderPolicy.FastestToSlowest)] [Orderer(SummaryOrderPolicy.FastestToSlowest)]
public class Benchmark public class Benchmarks
{ {
private static readonly string[] Arguments = {"--str", "hello world", "-i", "13", "-b"}; private static readonly string[] Arguments = {"--str", "hello world", "-i", "13", "-b"};
@@ -42,5 +44,8 @@ namespace CliFx.Benchmarks
[Benchmark(Description = "Cocona")] [Benchmark(Description = "Cocona")]
public void ExecuteWithCocona() => public void ExecuteWithCocona() =>
Cocona.CoconaApp.Run<CoconaCommand>(Arguments); Cocona.CoconaApp.Run<CoconaCommand>(Arguments);
public static void Main() =>
BenchmarkRunner.Run<Benchmarks>(DefaultConfig.Instance.With(ConfigOptions.DisableOptimizationsValidator));
} }
} }

View File

@@ -1,12 +0,0 @@
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Running;
namespace CliFx.Benchmarks
{
public static class Program
{
public static void Main() =>
BenchmarkRunner.Run(typeof(Program).Assembly, DefaultConfig.Instance
.With(ConfigOptions.DisableOptimizationsValidator));
}
}