Benchmarks¶
Performance comparison between source-generated and reflection-based dependency injection.
Key Takeaway
Source generation provides faster container build times compared to reflection. Service resolution performance is identical once the container is built.
Summary¶
Loading benchmark results...
Running Benchmarks Locally¶
To run all benchmarks:
CI Integration¶
Benchmarks run automatically:
- Weekly: Every Sunday at 3am UTC (if code has changed)
- On-demand: Via workflow dispatch
Results are published to this page after each run.
Methodology¶
All benchmarks use BenchmarkDotNet with:
- ShortRun job: 3 warmup iterations, 3 target iterations
- Memory diagnostics: Tracks allocations per operation
- Baseline comparison: Reflection is always the baseline
Each benchmark class follows strict rules:
- One baseline per class (reflection approach)
- All methods in a class compare the same scenario
- Benchmark methods contain only what needs to be measured