Hey everyone. Just wanted to share a personal milestone. I'm building an RTS engine and wanted to push C# to its absolute limits without relying on heavy third-party frameworks.
My goal was zero garbage collection during the game loop.
Architecture: Strict Data-Oriented Design (DOD). Everything is laid out in unmanaged memory blocks with strict cache-line alignment (64 bytes). The engine loop is currently 100% single-threaded .
Rendering: Custom 2D software renderer using AVX2 intrinsics (supports layering and masks).
Interop: Function pointers ( delegate* unmanaged ) to completely hide unsafe code from the user API.
RAM Usage: A rock-solid 39 MB (as seen in the Task Manager screenshot), which perfectly matches my internal pre-allocated memory pool. No hidden CLR bloat.
To prove the Zero-GC claim, I ran the core loop through BenchmarkDotNet.
The result?…