Skip to main content

Invocation Benchmark

Calling methods on mock objects — 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​

Calling methods on mock objects:

LibraryMeanErrorStdDevAllocated
TUnit.Mocks277.74 ns75.28 ns4.126 ns128 B
Imposter290.32 ns70.39 ns3.858 ns168 B
Mockolate104.55 ns16.36 ns0.897 ns84 B
Moq791.63 ns81.81 ns4.485 ns376 B
NSubstitute722.70 ns458.58 ns25.136 ns304 B
FakeItEasy1,737.95 ns1,034.16 ns56.686 ns944 B

String​

LibraryMeanErrorStdDevAllocated
TUnit.Mocks171.11 ns160.94 ns8.822 ns96 B
Imposter298.89 ns83.26 ns4.564 ns168 B
Mockolate94.42 ns34.59 ns1.896 ns60 B
Moq562.45 ns222.27 ns12.183 ns296 B
NSubstitute667.74 ns34.01 ns1.864 ns328 B
FakeItEasy1,617.52 ns1,042.49 ns57.143 ns776 B

100 calls​

LibraryMeanErrorStdDevAllocated
TUnit.Mocks27,171.32 ns7,492.01 ns410.662 ns12736 B
Imposter29,764.99 ns16,487.62 ns903.742 ns16800 B
Mockolate10,722.31 ns22,218.98 ns1,217.897 ns8400 B
Moq80,465.61 ns22,902.61 ns1,255.369 ns37600 B
NSubstitute71,093.26 ns33,879.58 ns1,857.054 ns30848 B
FakeItEasy182,113.88 ns65,007.53 ns3,563.282 ns94400 B

🎯 Key Insights​

This benchmark compares TUnit.Mocks (source-generated) against runtime proxy-based mocking libraries for calling methods on mock objects.


Methodology

View the mock benchmarks overview for methodology details and environment information.

Last generated: 2026-09-27T02:37:02.890Z