Results Comparer

April 19, 2022 ยท View on GitHub

This simple tool allows for easy comparison of provided benchmark results.

It can be used to compare:

  • historical results (eg. before and after my changes)
  • results for different OSes (eg. Windows vs Ubuntu)
  • results for different CPU architectures (eg. x64 vs ARM64)
  • results for different target frameworks (eg. .NET Core 3.1 vs 5.0)

All you need to provide is:

  • --base - path to folder/file with baseline results
  • --diff - path to folder/file with diff results
  • --threshold - threshold for Statistical Test. Examples: 5%, 10ms, 100ns, 1s

Optional arguments:

  • --top - filter the diff to top/bottom N results
  • --noise - noise threshold for Statistical Test. The difference for 1.0ns and 1.1ns is 10%, but it's just a noise. Examples: 0.5ns 1ns. The default value is 0.3ns.
  • --csv - path to exported CSV results. Optional.
  • -f|--filter - filter the benchmarks by name using glob pattern(s). Optional.

Sample: compare the results stored in C:\results\windows vs C:\results\ubuntu using 1% threshold and print only TOP 10.

dotnet run --base "C:\results\windows" --diff "C:\results\ubuntu" --threshold 1% --top 10

Note: the tool supports only *full.json results exported by BenchmarkDotNet. This exporter is enabled by default in this repository.

Sample results

Slowerdiff/baseBase Median (ns)Diff Median (ns)Modality
PerfLabTests.BlockCopyPerf.CallBlockCopy(numElements: 100)1.609.2214.76
System.Tests.Perf_String.Trim_CharArr(s: "Test", c: [' ', ' '])1.416.188.72
Fasterbase/diffBase Median (ns)Diff Median (ns)Modality
System.Tests.Perf_Array.ArrayCopy3D1.31372.71284.73

If there is no difference or if there is no match (we use full benchmark names to match the benchmarks), then the results are omitted.

Matrix

The tools supports also comparing multiple result sets. For up-to-date help please run dotnet run -- matrix --help.

Sample usage:

dotnet run -c Release matrix decompress --input D:\results\Performance-Runs.zip --output D:\results\net7.0-preview3
dotnet run -c Release matrix --input D:\results\net7.0-preview3 --base net7.0-preview2 --diff net7.0-preview3 --threshold 10% --noise 2ns --filter System.IO*

Sample results:

System.IO.Tests.Perf_File.WriteAllText(size: 10000)

ResultBaseDiffRatioAlloc DeltaModalityOperating SystemBitProcessor NameBase VDiff V
Same939321.021031195.700.91+0several?Windows 10X64Intel Xeon CPU E5-1650 v4 3.60GHz7.0.22.122047.0.22.17504
Faster1059005.27598518.921.77+0bimodalWindows 11X64AMD Ryzen Threadripper PRO 3945WX 12-Cores7.0.22.122047.0.22.17504
Faster937008.80551313.281.70+0several?Windows 11X64AMD Ryzen 9 5900X7.0.22.122047.0.22.17504
Faster4346259.383206257.031.36+0several?Windows 11X64Intel Core i5-4300U CPU 1.90GHz (Haswell)7.0.22.122047.0.22.17504
Faster2573217.71832166.183.09-6Windows 11X64Unknown processor7.0.22.122047.0.22.17504
Same235188.35217942.501.08+0Windows 11X64Intel Core i7-8700 CPU 3.20GHz (Coffee Lake)7.0.22.122047.0.22.17504
Same824210.94749032.291.10+1Windows 11X64Intel Core i9-9900T CPU 2.10GHz7.0.22.122047.0.22.17504
Same50128.5350988.470.98+0alpine 3.13X64Intel Core i7-7700 CPU 3.60GHz (Kaby Lake)7.0.22.122047.0.22.17504
Same79680.1678657.241.01+0centos 7X64Intel Xeon CPU E5530 2.40GHz7.0.22.122047.0.22.17504
Same48132.1448840.280.99+0debian 11X64Intel Core i7-7700 CPU 3.60GHz (Kaby Lake)7.0.22.122047.0.22.17504
Same42636.2144366.440.96+0several?pop 20.04X64Intel Core i7-6600U CPU 2.60GHz (Skylake)7.0.22.122047.0.22.17504
Same32762.4232443.191.01+0bimodalubuntu 18.04X64Intel Xeon CPU E5-1650 v4 3.60GHz7.0.22.122047.0.22.17504
Faster64744.2455839.561.16+0bimodalubuntu 18.04X64Intel Core i7-2720QM CPU 2.20GHz (Sandy Bridge)7.0.22.122047.0.22.17504
Same3684335.973726101.030.99+0alpine 3.12Arm64Unknown processor7.0.22.122047.0.22.17504
Same60851.8957414.921.06+0debian 11Arm64Unknown processor7.0.22.122047.0.22.17504
Same84304.4883274.121.01+0ubuntu 18.04Arm64Unknown processor7.0.22.122047.0.22.17504
Faster2489377.68515978.134.82-5Windows 10Arm64Microsoft SQ1 3.0 GHz7.0.22.122047.0.22.17504
Faster2675980.21939078.312.85-5Windows 11Arm64Microsoft SQ1 3.0 GHz7.0.22.122047.0.22.17504
Faster1158829.33469372.132.47-1Windows 10X86Intel Xeon CPU E5-1650 v4 3.60GHz7.0.22.122047.0.22.17504
Faster929645.42507981.701.83-2bimodalWindows 11X86AMD Ryzen Threadripper PRO 3945WX 12-Cores7.0.22.122047.0.22.17504
Faster3215358.93440157.777.31-6Windows 11X86Intel Core i7-10510U CPU 1.80GHz7.0.22.122047.0.22.17504
Same126829.97121465.991.04+0Windows 7 SP1X86Intel Core i7-7700 CPU 3.60GHz (Kaby Lake)7.0.22.122047.0.22.17504
Same218819.23214187.241.02-1bimodalubuntu 18.04ArmARMv7 Processor rev 3 (v7l)7.0.22.122047.0.22.17504
Faster2478265.18547273.174.53-5Windows 10ArmMicrosoft SQ1 3.0 GHz7.0.22.122047.0.22.17504
Same161909.04158812.341.02+0macOS Monterey 12.2.1X64Intel Core i7-5557U CPU 3.10GHz (Broadwell)7.0.22.122047.0.22.17504
Same121620.87122424.610.99+0macOS Monterey 12.3.1X64Intel Core i7-4870HQ CPU 2.50GHz (Haswell)7.0.22.122047.0.22.17504