What problem does it solve?
Ensures reliable, reproducible microbenchmark results for .NET code by prescribing correct BenchmarkDotNet setup, diagnosers, exporters, and execution practices to avoid common measurement pitfalls such as debug-mode runs, dead code elimination, and noisy environment artifacts.
Core Features & Use Cases
- Benchmark Setup & Lifecycle: Guidance on benchmark project layout, [Benchmark] attributes, GlobalSetup vs IterationSetup, and running in Release for valid measurements.
- Diagnostics & Validation: Instructions for MemoryDiagnoser and DisassemblyDiagnoser to detect allocations and verify JIT optimizations, plus tips to prevent dead code elimination and measurement bias.
- CI Integration & Analysis: Recommendations for exporters (JSON, HTML, Markdown), artifact paths, and baseline comparisons for automated regression checks in CI pipelines.
Quick Start
Run your benchmark project in Release mode, enable JsonExporter.Full and MemoryDiagnoser, and upload the BenchmarkDotNet.Artifacts/results directory as CI artifacts for analysis.