Posts

Showing posts from January, 2026

MetalRaft: When Zero-Cost Abstractions Become Expensive

“ In this project, we ONLY use generic parameters. No dynamic dispatching! ‘Cause we care a lot about performance”, said the architect. At first glance, this position appears entirely defensible. Zero-cost abstractions are one of Rust’s signature features, and avoiding unnecessary indirection is often the correct engineering choice. Yet, I knew from the start that such blanket statements always hide surprises. In other words, the statement does not address whether “zero-cost” applies beyond runtime performance, nor how those trade-offs evolve as a system grows in scope and abstraction depth. The Experiment Setup Months later, when I deliberately decided to explore multiple architectural variations for a well-known and sufficiently complex system in Rust, the statement came back to my mind, and I set out to build this project by fully adhering to it. The intent was clear: Show that after a specific project size is reached, the principle of diminishing returns kicks in hard and by th...