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

Environment: Ubuntu Latest • .NET SDK 10.0.301

📊 Results

Calling methods on mock objects:

LibraryMeanErrorStdDevAllocated
TUnit.Mocks274.30 ns84.75 ns4.645 ns128 B
Imposter299.71 ns102.19 ns5.601 ns168 B
Mockolate113.03 ns91.96 ns5.041 ns84 B
Moq840.74 ns384.87 ns21.096 ns376 B
NSubstitute731.26 ns410.40 ns22.495 ns304 B
FakeItEasy1,829.35 ns665.19 ns36.461 ns944 B

String

LibraryMeanErrorStdDevAllocated
TUnit.Mocks164.97 ns83.03 ns4.551 ns96 B
Imposter297.64 ns37.45 ns2.053 ns168 B
Mockolate98.91 ns61.26 ns3.358 ns60 B
Moq542.47 ns132.25 ns7.249 ns296 B
NSubstitute617.86 ns221.96 ns12.167 ns272 B
FakeItEasy1,646.66 ns530.99 ns29.105 ns776 B

100 calls

LibraryMeanErrorStdDevAllocated
TUnit.Mocks27,510.06 ns12,122.14 ns664.455 ns12736 B
Imposter29,165.33 ns5,473.69 ns300.031 ns16800 B
Mockolate11,450.03 ns9,546.58 ns523.280 ns8400 B
Moq83,228.57 ns31,238.95 ns1,712.312 ns37600 B
NSubstitute73,835.14 ns21,865.92 ns1,198.545 ns30848 B
FakeItEasy189,604.89 ns43,458.06 ns2,382.083 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-06-27T03:27:29.619Z