Setup Benchmark
Mock behavior configuration (returns, matchers) — 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
Mock behavior configuration (returns, matchers):
| Library | Mean | Error | StdDev | Allocated |
|---|---|---|---|---|
| TUnit.Mocks | 432.4 ns | 3.36 ns | 3.14 ns | 2.34 KB |
| Imposter | 613.6 ns | 4.66 ns | 4.13 ns | 6.12 KB |
| Mockolate | 259.4 ns | 2.07 ns | 1.93 ns | 1.41 KB |
| Moq | 240,747.4 ns | 1,182.73 ns | 987.64 ns | 28.56 KB |
| NSubstitute | 3,992.4 ns | 71.25 ns | 87.50 ns | 9.01 KB |
| FakeItEasy | 5,743.4 ns | 54.01 ns | 50.52 ns | 10.6 KB |
Multiple
| Library | Mean | Error | StdDev | Allocated |
|---|---|---|---|---|
| TUnit.Mocks | 652.5 ns | 13.08 ns | 13.43 ns | 3.15 KB |
| Imposter | 1,069.2 ns | 12.40 ns | 11.60 ns | 10.59 KB |
| Mockolate | 440.6 ns | 3.18 ns | 2.82 ns | 2.35 KB |
| Moq | 69,749.9 ns | 797.28 ns | 706.77 ns | 16.53 KB |
| NSubstitute | 8,692.4 ns | 82.19 ns | 76.88 ns | 20.31 KB |
| FakeItEasy | 5,416.4 ns | 38.15 ns | 33.82 ns | 11.71 KB |
🎯 Key Insights
This benchmark compares TUnit.Mocks (source-generated) against runtime proxy-based mocking libraries for mock behavior configuration (returns, matchers).
Methodology
View the mock benchmarks overview for methodology details and environment information.
Last generated: 2026-06-27T03:27:29.619Z