Skip to content

Technical Summary

A Technical Case Study on Zero-Overhead Mocking for Native AOT

Abstract

The transition to Cloud-Native architecture demands runtimes that are instant, lightweight, and efficient. Microsoft's Native AOT compilation delivers this, offering Go-like startup speeds for C# applications. However, enterprise adoption is stalled by a legacy dependency: Reflection.

Skugga proposes shifting mocking from Runtime to Compile-Time using C# 12 Interceptors. Results demonstrate a 5.1x improvement in CPU efficiency, a 4x reduction in deployment footprint, and linear build scalability.

Computational Efficiency

MetricStandard JITSkugga AOTImprovement
User CPU Time0.36s0.07s5.1x More Efficient
System CPU Time0.18s0.12s33% Less Overhead
Total Work0.54s0.19s2.8x Faster Completion

High-throughput microservices achieve 5x higher packing density in Kubernetes clusters.

Deployment Footprint

MetricStandard JITSkugga AOTImprovement
Artifact Size~200 MB47 MB4x Smaller
Attack SurfaceFull Linux OSScratch (No OS)Maximal Security

76% reduction in artifact size improves Mean Time To Recovery (MTTR) during auto-scaling events.

Scalability

Stress test with 500 distinct mocks:

  • Build Time: 0.41 seconds
  • Test Execution: 0.49 seconds (~1ms per test)

The Roslyn Incremental Generator pipeline ensures negligible build overhead at scale.

Conclusion

Skugga removes the runtime overhead of mocking, unlocking:

  1. Instant Startup (<50ms)
  2. Minimal Footprint (47MB)
  3. Maximum Efficiency (5.1x CPU gain)

Released under the MIT License.