Backend Sep 16, 2025

Rewrite, optimize, repeat: Our journey porting a triemap from C to Rust

In this talk, Lucas Palmieri from @mainmatter2180 shares his experience porting a battle-tested C TrieMap implementation to Rust, as part of a larger C-to-Rust migration of Redis’ search capabilities.

This talk will walk through the missteps, the initial design that was implemented and then discarded, the profiling rabbit holes, and the eventual breakthroughs that led us to a Rust version that not only matched but outperformed the original, without compromising safety and memory usage.

Along the way, the talk covers design tradeoffs, lessons in data layout, and how custom DSTs and a deep understanding of Rust’s memory model helped us turn a rewrite into a real upgrade. If you’ve ever been tempted to replace C with Rust (or you’re planning to), this talk is for you.