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-06-27 from the latest CI run.

Environment: Ubuntu Latest • .NET SDK 10.0.301

📊 Results

Mock instance creation performance:

LibraryMeanErrorStdDevAllocated
TUnit.Mocks30.28 ns0.458 ns0.383 ns200 B
Imposter99.81 ns1.960 ns1.925 ns440 B
Mockolate19.36 ns0.434 ns0.446 ns160 B
Moq1,347.30 ns10.095 ns8.949 ns2048 B
NSubstitute2,022.81 ns21.685 ns20.284 ns5000 B
FakeItEasy1,928.10 ns35.625 ns34.988 ns2715 B

Repository

LibraryMeanErrorStdDevAllocated
TUnit.Mocks30.25 ns0.589 ns0.522 ns200 B
Imposter156.20 ns3.113 ns2.912 ns696 B
Mockolate19.24 ns0.434 ns0.464 ns176 B
Moq1,496.07 ns10.637 ns9.430 ns1912 B
NSubstitute1,899.24 ns30.087 ns28.144 ns5000 B
FakeItEasy1,865.93 ns26.111 ns23.146 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-06-27T03:27:29.619Z