Upgrade BenchmarkDotNet to 0.16.0-preview.2 and benchmark .NET 11
Merged
BR
18d ago+28+28+01234567890123456789-30-30-01234567890123456789
Summary
Upgrades BenchmarkDotNet so the benchmarks can run on .NET 11, and drops .NET 9, which is out of support.
BenchmarkDotNet 0.15.8, the latest stable release, has no .NET 11 runtime (CoreRuntime.Core11_0). This moves to 0.16.0-preview.2, the first version with it.
Changes
- Benchmarks project: BenchmarkDotNet and BenchmarkDotNet.Diagnostics.Windows go from 0.15.2 to 0.16.0-preview.2. Targets are now
net48;net8.0;net10.0;net11.0. - net48 package references:
System.Collections.ImmutableandSystem.Reflection.Metadatago from 9.0.0 to 10.0.7, the minimum the new BenchmarkDotNet dependencies require. Restore fails with NU1605 otherwise. FrameworkCompareConfigandVersionComparisonConfig: .NET 11 jobs added and .NET 9 jobs removed.- 0.16 API changes:
- The job runtime moved from
Job.Environment.RuntimetoJob.Infrastructure.Runtime.Runtime.MsBuildMonikeris no longer public, soVersionComparisonOrderersorts byRuntime.Versionand groups byRuntime.NameplusRuntime.Version. In 0.16,Namealone is just ".NET", which would put every .NET runtime in one group. Results now list net48 first, then .NET 8, 10 and 11. X86X64ConfigbuildsNetCoreAppSettings { CliPath = ... }and passes it toCsProjCoreToolchain.From(runtime, settings). It was pinned to theNetCoreApp50settings and now targets .NET 10, so the 32-bitdotnetinstall needs the .NET 10 runtime.
- The job runtime moved from
Previousbuild fix (already broken onmain): theCompile Removeitems still namedInternal\VarIntEncoding*Tests.cs. The benchmarks are nowVarIntEncodingRead.csandVarIntEncodingWrite.csand callVarIntEncoding.TryWrite, which Snappier 1.2.0 lacks. EveryPreviousbaseline reported NA. The item is nowVarIntEncoding*.cs.- Tests and CI:
net9.0removed from the test project and from the x64 and ARM test matrices, along with the9.0.xSDK install.
Testing
- The solution builds with no errors or warnings.
- All 1,232 tests pass locally on .NET 8, 10 and 11 and on net48.
- A ShortRun of
UnalignedCopy64with the framework comparison config ran on .NET Framework 4.8 and .NET 8 through 11. - Version comparison ShortRun of
DecompressAll: all 88 benchmarks ran, Previous and current, on .NET Framework 4.8 and .NET 8, 10 and 11. - x86/x64 ShortRun of
UnalignedCopy64: the x64 job ran. The x86 job could not build on the test machine because its 32-bit dotnet install has no 11.0 SDK, whichglobal.jsonrequires. That is a machine setup issue, not a code issue, but x86 is still unverified.
š¤ Generated with Claude Code