Skip to main content

MockCreation Benchmark

Mock instance creation performance — comparing TUnit.Mocks (source-generated) against runtime proxy-based mocking libraries.

Last Updated

This benchmark was automatically generated on 2026-09-27 from the latest CI run.

Environment: Ubuntu Latest • .NET SDK 10.0.401

📊 Results​

Mock instance creation performance:

LibraryMeanErrorStdDevAllocated
TUnit.Mocks26.29 ns0.292 ns0.273 ns200 B
Imposter86.33 ns0.606 ns0.567 ns440 B
Mockolate16.62 ns0.239 ns0.212 ns160 B
Moq1,346.99 ns16.351 ns15.294 ns2048 B
NSubstitute1,878.51 ns10.994 ns10.284 ns5000 B
FakeItEasy1,739.06 ns14.547 ns13.607 ns2715 B

Repository​

LibraryMeanErrorStdDevAllocated
TUnit.Mocks26.49 ns0.252 ns0.235 ns200 B
Imposter134.63 ns1.052 ns0.933 ns696 B
Mockolate16.45 ns0.059 ns0.055 ns176 B
Moq1,323.73 ns7.731 ns6.853 ns1912 B
NSubstitute1,771.98 ns6.556 ns5.812 ns5000 B
FakeItEasy1,714.98 ns15.089 ns13.376 ns2715 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-09-27T02:37:02.890Z