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-08-14 from the latest CI run.

Environment: Ubuntu Latest • .NET SDK 10.0.400

📊 Results

Mock instance creation performance:

LibraryMeanErrorStdDevAllocated
TUnit.Mocks33.65 ns0.116 ns0.103 ns200 B
Imposter105.36 ns0.943 ns0.882 ns440 B
Mockolate19.91 ns0.167 ns0.148 ns160 B
Moq1,238.69 ns19.359 ns18.109 ns2048 B
NSubstitute1,790.32 ns31.290 ns29.269 ns5000 B
FakeItEasy1,772.04 ns35.277 ns60.850 ns2715 B

Repository

LibraryMeanErrorStdDevAllocated
TUnit.Mocks30.82 ns0.664 ns0.765 ns200 B
Imposter157.54 ns1.012 ns0.947 ns696 B
Mockolate18.45 ns0.152 ns0.135 ns176 B
Moq1,318.96 ns16.769 ns15.686 ns1912 B
NSubstitute1,872.39 ns26.909 ns25.171 ns5000 B
FakeItEasy1,898.57 ns36.613 ns54.801 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-08-14T03:10:39.371Z