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-11-12 from the latest CI run.

Environment: Ubuntu Latest • .NET SDK 11.0.100

📊 Results​

Mock instance creation performance:

LibraryMeanErrorStdDevAllocated
TUnit.Mocks30.68 ns0.597 ns0.586 ns216 B
Imposter80.68 ns1.393 ns1.303 ns360 B
Mockolate17.98 ns0.318 ns0.297 ns160 B
Moq1,180.14 ns12.085 ns10.713 ns2040 B
NSubstitute1,782.99 ns23.622 ns22.096 ns4984 B
FakeItEasy1,501.09 ns13.291 ns12.432 ns2715 B

Repository​

LibraryMeanErrorStdDevAllocated
TUnit.Mocks31.47 ns0.590 ns0.952 ns216 B
Imposter122.95 ns1.996 ns1.867 ns568 B
Mockolate19.20 ns0.354 ns0.407 ns176 B
Moq1,183.24 ns9.702 ns9.075 ns1904 B
NSubstitute1,788.80 ns8.713 ns7.724 ns4984 B
FakeItEasy1,525.93 ns12.245 ns11.454 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-11-12T02:21:42.541Z