Skip to main content

Verification Benchmark

Verifying mock method calls — 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​

Verifying mock method calls:

LibraryMeanErrorStdDevAllocated
TUnit.Mocks736.37 ns5.165 ns4.832 ns3040 B
Imposter277.96 ns3.553 ns3.324 ns1096 B
Mockolate389.24 ns2.691 ns2.247 ns2088 B
Moq277,018.99 ns1,633.598 ns1,528.069 ns24300 B
NSubstitute6,573.57 ns122.664 ns114.740 ns10024 B
FakeItEasy6,287.98 ns96.964 ns90.700 ns10506 B

Never​

LibraryMeanErrorStdDevAllocated
TUnit.Mocks59.92 ns1.136 ns1.062 ns336 B
Imposter149.09 ns2.276 ns2.129 ns616 B
Mockolate239.07 ns3.421 ns3.200 ns1096 B
Moq69,193.02 ns521.192 ns487.523 ns6917 B
NSubstitute3,573.91 ns63.607 ns56.386 ns7056 B
FakeItEasy3,258.26 ns38.522 ns36.034 ns5105 B

Multiple​

LibraryMeanErrorStdDevAllocated
TUnit.Mocks1,304.14 ns10.523 ns8.787 ns4528 B
Imposter583.07 ns6.706 ns6.273 ns2288 B
Mockolate1,016.51 ns7.047 ns6.247 ns5128 B
Moq385,311.39 ns1,923.941 ns1,705.523 ns35002 B
NSubstitute11,247.96 ns163.586 ns153.018 ns16633 B
FakeItEasy11,300.03 ns216.758 ns212.885 ns18703 B

🎯 Key Insights​

This benchmark compares TUnit.Mocks (source-generated) against runtime proxy-based mocking libraries for verifying mock method calls.


Methodology

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

Last generated: 2026-11-12T02:21:42.541Z