From 7ccfce3be12fac459c1b0b800709a0953bb45041 Mon Sep 17 00:00:00 2001 From: Leandro Fernandes Vieira Date: Sat, 23 Dec 2023 22:47:32 -0300 Subject: [PATCH] done --- .../FixedLengthReaderBenchmark.cs | 2 +- RecordParser.Benchmark/Program.cs | 32 +------------------ .../RecordParser.Benchmark.csproj | 2 +- .../VariableLengthReaderBenchmark.cs | 2 +- .../VariableLengthWriterBenchmark.cs | 2 +- 5 files changed, 5 insertions(+), 35 deletions(-) diff --git a/RecordParser.Benchmark/FixedLengthReaderBenchmark.cs b/RecordParser.Benchmark/FixedLengthReaderBenchmark.cs index 0e1d2fa..52246d6 100644 --- a/RecordParser.Benchmark/FixedLengthReaderBenchmark.cs +++ b/RecordParser.Benchmark/FixedLengthReaderBenchmark.cs @@ -15,7 +15,7 @@ namespace RecordParser.Benchmark { [MemoryDiagnoser] - [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class FixedLengthReaderBenchmark { [Params(400_000)] diff --git a/RecordParser.Benchmark/Program.cs b/RecordParser.Benchmark/Program.cs index 942bfd6..174bbad 100644 --- a/RecordParser.Benchmark/Program.cs +++ b/RecordParser.Benchmark/Program.cs @@ -11,37 +11,7 @@ static async Task Main(string[] args) #if DEBUG new VariableLengthReaderBenchmark() { LimitRecord = 500_000 }.Read_VariableLength_FullQuoted_RecordParser_Parallel(false, true); #else - Console.WriteLine("Benchmark options:"); - Console.WriteLine("0 - all"); - Console.WriteLine("1 - variable length writer"); - Console.WriteLine("2 - variable length reader"); - Console.WriteLine("3 - fixed length reader"); - Console.WriteLine("Digit the number of desired benchmark: "); - var option = int.Parse(Console.ReadLine()); - - switch (option) - { - case 0: - BenchmarkRunner.Run(); - BenchmarkRunner.Run(); - BenchmarkRunner.Run(); - break; - - case 1: - BenchmarkRunner.Run(); - break; - - case 2: - BenchmarkRunner.Run(); - break; - - case 3: - BenchmarkRunner.Run(); - break; - - default: - throw new NotSupportedException("invalid option"); - } + BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(); #endif Console.Out.Write("Hit to exit..."); Console.In.ReadLine(); diff --git a/RecordParser.Benchmark/RecordParser.Benchmark.csproj b/RecordParser.Benchmark/RecordParser.Benchmark.csproj index b85a32f..2255a7a 100644 --- a/RecordParser.Benchmark/RecordParser.Benchmark.csproj +++ b/RecordParser.Benchmark/RecordParser.Benchmark.csproj @@ -10,7 +10,7 @@ - + diff --git a/RecordParser.Benchmark/VariableLengthReaderBenchmark.cs b/RecordParser.Benchmark/VariableLengthReaderBenchmark.cs index 77ec9f3..72ef2e5 100644 --- a/RecordParser.Benchmark/VariableLengthReaderBenchmark.cs +++ b/RecordParser.Benchmark/VariableLengthReaderBenchmark.cs @@ -21,7 +21,7 @@ namespace RecordParser.Benchmark { [MemoryDiagnoser] - [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class VariableLengthReaderBenchmark { [Params(500_000)] diff --git a/RecordParser.Benchmark/VariableLengthWriterBenchmark.cs b/RecordParser.Benchmark/VariableLengthWriterBenchmark.cs index c4a2a2e..3eb0ad9 100644 --- a/RecordParser.Benchmark/VariableLengthWriterBenchmark.cs +++ b/RecordParser.Benchmark/VariableLengthWriterBenchmark.cs @@ -18,7 +18,7 @@ namespace RecordParser.Benchmark { [MemoryDiagnoser] - [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class VariableLengthWriterBenchmark { [Params(500_000)]