From 6340303bd5597cd4552f516a24d04894cde5a18e Mon Sep 17 00:00:00 2001 From: Lee Campbell Date: Fri, 20 Mar 2026 12:49:23 +0800 Subject: [PATCH 1/4] fix: align benchmark runtimes with project target frameworks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace obsolete benchmark job configuration (Net481, Core 2.1–7.0) with the actual target frameworks: net8.0, net9.0, and net10.0. Co-Authored-By: Claude Opus 4.6 --- HdrHistogram.Benchmarking/Program.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/HdrHistogram.Benchmarking/Program.cs b/HdrHistogram.Benchmarking/Program.cs index cd5ac63..d85c4e8 100644 --- a/HdrHistogram.Benchmarking/Program.cs +++ b/HdrHistogram.Benchmarking/Program.cs @@ -16,14 +16,9 @@ static void Main(string[] args) StatisticColumn.OperationsPerSecond, StatisticColumn.Mean, StatisticColumn.StdErr, StatisticColumn.StdDev, StatisticColumn.P0, StatisticColumn.Q1, StatisticColumn.P50, StatisticColumn.P67, StatisticColumn.Q3, StatisticColumn.P80, StatisticColumn.P90, StatisticColumn.P95, StatisticColumn.P100) - .AddJob(Job.Default.WithRuntime(ClrRuntime.Net481).WithJit(Jit.LegacyJit)) - .AddJob(Job.Default.WithRuntime(ClrRuntime.Net481).WithJit(Jit.RyuJit)) - .AddJob(Job.Default.WithRuntime(CoreRuntime.Core21)) - .AddJob(Job.Default.WithRuntime(CoreRuntime.Core31)) - .AddJob(Job.Default.WithRuntime(CoreRuntime.Core50)) - .AddJob(Job.Default.WithRuntime(CoreRuntime.Core60)) - .AddJob(Job.Default.WithRuntime(CoreRuntime.Core70)) .AddJob(Job.Default.WithRuntime(CoreRuntime.Core80)) + .AddJob(Job.Default.WithRuntime(CoreRuntime.Core90)) + .AddJob(Job.Default.WithRuntime(CoreRuntime.CreateForNewVersion("net10.0", "Core 10.0"))) ; var switcher = new BenchmarkSwitcher(new[] { From 458b8d14776b4415f81a0ef761c224c126491541 Mon Sep 17 00:00:00 2001 From: Lee Campbell Date: Fri, 20 Mar 2026 13:23:23 +0800 Subject: [PATCH 2/4] fix: drop manual runtime jobs to avoid BenchmarkDotNet net10.0 crash BenchmarkDotNet 0.15.8 does not recognise the net10.0 moniker via CreateForNewVersion, throwing NotImplementedException. Remove the manual job/column config and use DefaultConfig instead. Specific runtimes can be targeted via CLI args (--runtimes net8.0 net9.0). Co-Authored-By: Claude Opus 4.6 --- HdrHistogram.Benchmarking/Program.cs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/HdrHistogram.Benchmarking/Program.cs b/HdrHistogram.Benchmarking/Program.cs index d85c4e8..966a7ed 100644 --- a/HdrHistogram.Benchmarking/Program.cs +++ b/HdrHistogram.Benchmarking/Program.cs @@ -1,7 +1,3 @@ -using BenchmarkDotNet.Columns; -using BenchmarkDotNet.Configs; -using BenchmarkDotNet.Environments; -using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Running; namespace HdrHistogram.Benchmarking @@ -10,23 +6,12 @@ class Program { static void Main(string[] args) { - var config = ManualConfig.Create(DefaultConfig.Instance) - //.AddDiagnoser(MemoryDiagnoser.Default) - .AddColumn( - StatisticColumn.OperationsPerSecond, - StatisticColumn.Mean, StatisticColumn.StdErr, StatisticColumn.StdDev, - StatisticColumn.P0, StatisticColumn.Q1, StatisticColumn.P50, StatisticColumn.P67, StatisticColumn.Q3, StatisticColumn.P80, StatisticColumn.P90, StatisticColumn.P95, StatisticColumn.P100) - .AddJob(Job.Default.WithRuntime(CoreRuntime.Core80)) - .AddJob(Job.Default.WithRuntime(CoreRuntime.Core90)) - .AddJob(Job.Default.WithRuntime(CoreRuntime.CreateForNewVersion("net10.0", "Core 10.0"))) - ; - var switcher = new BenchmarkSwitcher(new[] { typeof(LeadingZeroCount.LeadingZeroCount64BitBenchmark), typeof(LeadingZeroCount.LeadingZeroCount32BitBenchmark), typeof(Recording.Recording32BitBenchmark), }); - switcher.Run(args, config); + switcher.Run(args); } } } From e951b7fc0b284125f06d27e839216ed91e1853dc Mon Sep 17 00:00:00 2001 From: Lee Campbell Date: Fri, 20 Mar 2026 13:29:16 +0800 Subject: [PATCH 3/4] fix: restore benchmark columns and multi-runtime config Restore the original percentile/statistics columns and multi-runtime job configuration. Keep net8.0 and net9.0 runtimes (net10.0 is not yet supported by BenchmarkDotNet 0.15.8). Update build.cmd to pass --runtimes net8.0 net9.0 so both configured runtimes are exercised. Co-Authored-By: Claude Opus 4.6 --- HdrHistogram.Benchmarking/Program.cs | 15 ++++++++++++++- build.cmd | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/HdrHistogram.Benchmarking/Program.cs b/HdrHistogram.Benchmarking/Program.cs index 966a7ed..0cb3dd9 100644 --- a/HdrHistogram.Benchmarking/Program.cs +++ b/HdrHistogram.Benchmarking/Program.cs @@ -1,3 +1,7 @@ +using BenchmarkDotNet.Columns; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Environments; +using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Running; namespace HdrHistogram.Benchmarking @@ -6,12 +10,21 @@ class Program { static void Main(string[] args) { + var config = ManualConfig.Create(DefaultConfig.Instance) + .AddColumn( + StatisticColumn.OperationsPerSecond, + StatisticColumn.Mean, StatisticColumn.StdErr, StatisticColumn.StdDev, + StatisticColumn.P0, StatisticColumn.Q1, StatisticColumn.P50, StatisticColumn.P67, StatisticColumn.Q3, StatisticColumn.P80, StatisticColumn.P90, StatisticColumn.P95, StatisticColumn.P100) + .AddJob(Job.Default.WithRuntime(CoreRuntime.Core80)) + .AddJob(Job.Default.WithRuntime(CoreRuntime.Core90)) + ; + var switcher = new BenchmarkSwitcher(new[] { typeof(LeadingZeroCount.LeadingZeroCount64BitBenchmark), typeof(LeadingZeroCount.LeadingZeroCount32BitBenchmark), typeof(Recording.Recording32BitBenchmark), }); - switcher.Run(args); + switcher.Run(args, config); } } } diff --git a/build.cmd b/build.cmd index 78f9c23..380b8ac 100644 --- a/build.cmd +++ b/build.cmd @@ -18,4 +18,4 @@ IF %ERRORLEVEL% NEQ 0 GOTO EOF dotnet pack .\HdrHistogram\HdrHistogram.csproj --no-build --include-symbols -c=Release /p:Version=%SemVer% IF %ERRORLEVEL% NEQ 0 GOTO EOF -.\HdrHistogram.Benchmarking\bin\Release\net8.0\HdrHistogram.Benchmarking.exe -f * \ No newline at end of file +.\HdrHistogram.Benchmarking\bin\Release\net8.0\HdrHistogram.Benchmarking.exe -f * --runtimes net8.0 net9.0 \ No newline at end of file From f3934e98270ef5e1f6c1f8569593cbdc8b55bbdc Mon Sep 17 00:00:00 2001 From: Lee Campbell Date: Fri, 20 Mar 2026 13:52:37 +0800 Subject: [PATCH 4/4] fix: use CoreRuntime.Core10_0 for net10.0 benchmark job BenchmarkDotNet 0.15.8 supports net10.0 via CoreRuntime.Core10_0, not CreateForNewVersion. Revert build.cmd to original form without --runtimes flag as the jobs are configured in code. Co-Authored-By: Claude Opus 4.6 --- HdrHistogram.Benchmarking/Program.cs | 1 + build.cmd | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/HdrHistogram.Benchmarking/Program.cs b/HdrHistogram.Benchmarking/Program.cs index 0cb3dd9..881c88e 100644 --- a/HdrHistogram.Benchmarking/Program.cs +++ b/HdrHistogram.Benchmarking/Program.cs @@ -17,6 +17,7 @@ static void Main(string[] args) StatisticColumn.P0, StatisticColumn.Q1, StatisticColumn.P50, StatisticColumn.P67, StatisticColumn.Q3, StatisticColumn.P80, StatisticColumn.P90, StatisticColumn.P95, StatisticColumn.P100) .AddJob(Job.Default.WithRuntime(CoreRuntime.Core80)) .AddJob(Job.Default.WithRuntime(CoreRuntime.Core90)) + .AddJob(Job.Default.WithRuntime(CoreRuntime.Core10_0)) ; var switcher = new BenchmarkSwitcher(new[] { diff --git a/build.cmd b/build.cmd index 380b8ac..78f9c23 100644 --- a/build.cmd +++ b/build.cmd @@ -18,4 +18,4 @@ IF %ERRORLEVEL% NEQ 0 GOTO EOF dotnet pack .\HdrHistogram\HdrHistogram.csproj --no-build --include-symbols -c=Release /p:Version=%SemVer% IF %ERRORLEVEL% NEQ 0 GOTO EOF -.\HdrHistogram.Benchmarking\bin\Release\net8.0\HdrHistogram.Benchmarking.exe -f * --runtimes net8.0 net9.0 \ No newline at end of file +.\HdrHistogram.Benchmarking\bin\Release\net8.0\HdrHistogram.Benchmarking.exe -f * \ No newline at end of file