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

Environment: Ubuntu Latest • .NET SDK 10.0.400

📊 Results

Calling methods on mock objects:

LibraryMeanErrorStdDevAllocated
TUnit.Mocks268.45 ns79.80 ns4.374 ns128 B
Imposter289.00 ns93.15 ns5.106 ns168 B
Mockolate101.83 ns11.66 ns0.639 ns84 B
Moq793.18 ns106.36 ns5.830 ns376 B
NSubstitute705.40 ns182.39 ns9.997 ns304 B
FakeItEasy1,719.24 ns1,055.03 ns57.830 ns944 B

String

LibraryMeanErrorStdDevAllocated
TUnit.Mocks165.63 ns73.61 ns4.035 ns96 B
Imposter285.75 ns97.75 ns5.358 ns168 B
Mockolate97.13 ns99.25 ns5.440 ns60 B
Moq514.02 ns74.25 ns4.070 ns296 B
NSubstitute601.32 ns166.86 ns9.146 ns272 B
FakeItEasy1,503.70 ns106.49 ns5.837 ns776 B

100 calls

LibraryMeanErrorStdDevAllocated
TUnit.Mocks26,709.70 ns9,762.66 ns535.125 ns12736 B
Imposter29,107.61 ns4,931.72 ns270.324 ns16800 B
Mockolate10,542.20 ns5,476.53 ns300.187 ns8400 B
Moq76,246.07 ns6,397.02 ns350.642 ns37600 B
NSubstitute70,813.61 ns33,905.80 ns1,858.491 ns30848 B
FakeItEasy171,122.68 ns44,291.21 ns2,427.751 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-08-14T03:10:39.371Z