mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Cleanup benchmarks
This commit is contained in:
@@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user