Skip to main content

Callback Benchmark

Callback registration and execution — 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​

Callback registration and execution:

LibraryMeanErrorStdDevAllocated
TUnit.Mocks522.6 ns10.14 ns15.78 ns3200 B
Imposter198.6 ns1.72 ns1.53 ns848 B
Mockolate251.8 ns1.63 ns1.45 ns1824 B
Moq118,998.2 ns407.08 ns339.93 ns13573 B
NSubstitute3,597.3 ns39.23 ns30.63 ns8008 B
FakeItEasy3,748.9 ns41.48 ns36.77 ns7549 B

with args​

LibraryMeanErrorStdDevAllocated
TUnit.Mocks636.3 ns9.62 ns9.00 ns3296 B
Imposter233.1 ns1.82 ns1.71 ns896 B
Mockolate290.2 ns3.09 ns2.89 ns1872 B
Moq126,053.1 ns522.00 ns407.54 ns13987 B
NSubstitute4,043.3 ns44.31 ns41.45 ns8584 B
FakeItEasy4,623.8 ns89.45 ns91.86 ns9624 B

🎯 Key Insights​

This benchmark compares TUnit.Mocks (source-generated) against runtime proxy-based mocking libraries for callback registration and execution.


Methodology

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

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