Callback Benchmark
Callback registration and execution — comparing TUnit.Mocks (source-generated) against runtime proxy-based mocking libraries.
Last Updated
This benchmark was automatically generated on 2026-06-27 from the latest CI run.
Environment: Ubuntu Latest • .NET SDK 10.0.301
📊 Results
Callback registration and execution:
| Library | Mean | Error | StdDev | Allocated |
|---|---|---|---|---|
| TUnit.Mocks | 821.8 ns | 12.16 ns | 11.37 ns | 3.11 KB |
| Imposter | 605.9 ns | 4.28 ns | 3.79 ns | 2.66 KB |
| Mockolate | 447.1 ns | 7.08 ns | 6.62 ns | 1.8 KB |
| Moq | 143,169.5 ns | 2,027.59 ns | 1,896.61 ns | 13.29 KB |
| NSubstitute | 4,376.7 ns | 25.69 ns | 22.78 ns | 7.93 KB |
| FakeItEasy | 5,295.8 ns | 30.93 ns | 27.42 ns | 7.43 KB |
with args
| Library | Mean | Error | StdDev | Allocated |
|---|---|---|---|---|
| TUnit.Mocks | 962.7 ns | 5.89 ns | 5.51 ns | 3.2 KB |
| Imposter | 645.7 ns | 7.50 ns | 7.02 ns | 2.82 KB |
| Mockolate | 503.2 ns | 3.10 ns | 2.90 ns | 1.84 KB |
| Moq | 147,052.5 ns | 2,068.55 ns | 1,934.92 ns | 13.75 KB |
| NSubstitute | 4,989.9 ns | 32.08 ns | 26.79 ns | 8.53 KB |
| FakeItEasy | 6,818.3 ns | 29.05 ns | 27.17 ns | 9.41 KB |
🎯 Key Insights
This benchmark compares TUnit.Mocks (source-generated) against runtime proxy-based mocking libraries for callback registration and execution.
Methodology
View the mock benchmarks overview for methodology details and environment information.
Last generated: 2026-06-27T03:27:29.619Z