MockCreation Benchmark
Last Updated
This benchmark was automatically generated on 2026-05-13 from the latest CI run.
Environment: Ubuntu Latest • .NET SDK 10.0.300
📊 Results
Mock instance creation performance:
| Library | Mean | Error | StdDev | Allocated |
|---|---|---|---|---|
| TUnit.Mocks | 24.96 ns | 0.278 ns | 0.247 ns | 192 B |
| Imposter | 90.15 ns | 0.914 ns | 0.855 ns | 440 B |
| Mockolate | 60.17 ns | 0.887 ns | 0.786 ns | 424 B |
| Moq | 1,389.89 ns | 16.708 ns | 15.628 ns | 2048 B |
| NSubstitute | 1,920.10 ns | 17.034 ns | 15.100 ns | 5000 B |
| FakeItEasy | 1,828.75 ns | 28.341 ns | 26.510 ns | 2715 B |
Repository
| Library | Mean | Error | StdDev | Allocated |
|---|---|---|---|---|
| TUnit.Mocks | 25.12 ns | 0.414 ns | 0.367 ns | 192 B |
| Imposter | 145.10 ns | 1.570 ns | 1.468 ns | 696 B |
| Mockolate | 63.41 ns | 1.261 ns | 1.453 ns | 456 B |
| Moq | 1,258.91 ns | 7.526 ns | 7.040 ns | 1912 B |
| NSubstitute | 1,890.06 ns | 23.930 ns | 22.384 ns | 5000 B |
| FakeItEasy | 1,845.67 ns | 28.574 ns | 26.728 ns | 2715 B |
🎯 Key Insights
This benchmark compares TUnit.Mocks (source-generated) against runtime proxy-based mocking libraries for mock instance creation performance.
Methodology
View the mock benchmarks overview for methodology details and environment information.
Last generated: 2026-05-13T03:26:48.570Z