diff --git a/tool/DotRecast.Tool.Benchmark/BenchmarkProgram.cs b/tool/DotRecast.Tool.Benchmark/BenchmarkProgram.cs deleted file mode 100644 index 7bbd6b8c..00000000 --- a/tool/DotRecast.Tool.Benchmark/BenchmarkProgram.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Immutable; -using System.Linq; -using BenchmarkDotNet.Running; -using DotRecast.Tool.Benchmark.Benchmarks; - -namespace DotRecast.Tool.Benchmark; - -public static class BenchmarkProgram -{ - public static int Main(string[] args) - { - var runs = ImmutableArray.Create( - // BenchmarkConverter.TypeToBenchmarks(typeof(VectorBenchmarks)), - // BenchmarkConverter.TypeToBenchmarks(typeof(PriorityQueueBenchmarks)), - BenchmarkConverter.TypeToBenchmarks(typeof(ArrayBenchmarks)) - ); - - var summary = BenchmarkRunner.Run(runs.ToArray()); - - return 0; - } -} \ No newline at end of file diff --git a/tool/DotRecast.Tool.Benchmark/Program.cs b/tool/DotRecast.Tool.Benchmark/Program.cs new file mode 100644 index 00000000..62a54098 --- /dev/null +++ b/tool/DotRecast.Tool.Benchmark/Program.cs @@ -0,0 +1,31 @@ +using System; +using BenchmarkDotNet.Running; +using DotRecast.Tool.Benchmark.Benchmarks; + +namespace DotRecast.Tool.Benchmark; + +public static class Program +{ + public static int Main(string[] args) + { + Type[] benchmarkTypes = + [ + typeof(VectorBenchmarks), + typeof(PriorityQueueBenchmarks), + typeof(ArrayBenchmarks) + ]; + + var switcher = new BenchmarkSwitcher(benchmarkTypes); + + if (args == null || args.Length == 0) + { + switcher.RunAll(); + } + else + { + switcher.Run(args); + } + + return 0; + } +} \ No newline at end of file