diff --git a/Benchmarker/Program.cs b/Benchmarker/Program.cs index 88fca5f..6994d82 100644 --- a/Benchmarker/Program.cs +++ b/Benchmarker/Program.cs @@ -20,7 +20,7 @@ private static void Main(string[] args) var options = new Options(); #if RELEASE - Parser.Default.ParseArguments(args).WithParsed(opts => + Parser.Default.ParseArguments(args).WithParsed(opts => { options = opts; @@ -42,6 +42,11 @@ private static void Main(string[] args) } }); + if (options.ListBenchmarks) + { + Console.WriteLine(string.Join(", ", BenchmarkRunner.AvailableBenchmarks)); + } + if (options?.Benchmark == null) { return; diff --git a/Benchmarking.sln b/Benchmarking.sln index 1e5246b..4ffcb8e 100644 --- a/Benchmarking.sln +++ b/Benchmarking.sln @@ -12,6 +12,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Dockerfile.alpine = Dockerfile.alpine Dockerfile.arm32v7 = Dockerfile.arm32v7 Dockerfile.arm64 = Dockerfile.arm64 + .github\workflows\label-manager.yml = .github\workflows\label-manager.yml + .github\labels.json = .github\labels.json + .github\workflows\netcore.yml = .github\workflows\netcore.yml + Readme.md = Readme.md + .github\workflows\secrets-checker.yml = .github\workflows\secrets-checker.yml EndProjectSection EndProject Global diff --git a/Benchmarking/Options.cs b/Benchmarking/Options.cs index 4a8747c..a3309c8 100644 --- a/Benchmarking/Options.cs +++ b/Benchmarking/Options.cs @@ -7,13 +7,16 @@ public class Options [Option('t', "threads", Required = false, Default = 0, HelpText = "Manually set the number of threads to use (overrides multithreaded)")] public int Threads { get; set; } = 1; - [Option('r', "runs", Required = false, HelpText = "Times to run the benchmark and average the result")] + [Option('r', "runs", Default = 3, HelpText = "Times to run the benchmark and average the result")] public int Runs { get; set; } = 3; - [Option('m', "multithreaded", Required = false, HelpText = "Run benchmarks multithreaded (automatically uses all logical processors)")] + [Option('m', "multithreaded", Default = false, HelpText = "Run benchmarks multithreaded (automatically uses all logical processors)")] public bool Multithreaded { get; set; } = false; - [Option('b', "benchmark", Required = true, HelpText = "Choose the benchmark to run")] + [Option('b', "benchmark", HelpText = "Choose the benchmark to run")] public string Benchmark { get; set; } + + [Option('l', "list-benchmarks", Default = false, HelpText = "List available benchmarks")] + public bool ListBenchmarks { get; set; } } } \ No newline at end of file