Skip to content

Benchmark Overview ​

Skugga's compile-time architecture delivers measurable performance advantages across all mocking operations.

Framework Comparison (12 Scenarios) ​

50,000 iterations per scenario | Intel Core i7-4980HQ @ 2.80GHz | .NET 10.0.1

FrameworkSpeed vs SkuggaNotes
SkuggaBaselineCompile-time, zero reflection
Moq2.6-80x slower80x on argument matching
NSubstitute3.5x slowerConsistent overhead
FakeItEasy3.9x slowerSimilar pattern

Scenario Breakdown (Skugga vs Moq) ​

ScenarioSpeedupImpact
Argument Matching79.84xLargest gap due to expression tree overhead
Void Method Setup59.26xProxy creation vs static dispatch
Callback Execution53.34xDelegate wrapping overhead
Mock Creation15.29xConstructor vs Reflection.Emit
Simple Setup/Returns2.58xBaseline overhead

Real-World Impact ​

For a test suite with 10,000 tests using argument matchers:

FrameworkTimeSavings
Skugga2.7s--
Moq218s215s saved
NSubstitute9.5s6.8s saved
FakeItEasy10.5s7.8s saved

Why Skugga is Faster ​

AspectLegacy (Moq)Skugga
Proxy GenerationReflection.Emit at runtimeRoslyn at build time
Method DispatchMethodInfo + expression evalDictionary lookup
Argument MatchingExpression.Lambda().Compile()Direct predicate call
Memory~4,150 bytes/mock~1,110 bytes/mock

Reproducing Results ​

bash
dotnet run --project src/Skugga.Benchmarks/Skugga.Benchmarks.csproj -c Release

Results are saved to /benchmarks/MoqVsSkugga.md and /benchmarks/FourFramework.md.

Released under the MIT License.