~/talk

"Rewrite, Optimize, Repeat: Our Journey Porting a Triemap from C to Rust"

Talkat RustConf 2025 · 2025-09-02..09-05· [databases]
slides:none on file

Porting a C TrieMap to Rust starts with a baseline: safe Rust reimplementation (roughly 2x slower and ~2x memory than C) and moves to an optimized unsafe design that matches or outperforms C. Work uses microbenchmarks (Criterion), end-to-end suites, property tests, and Miri checks; implements a custom DST/NodeData with manual alloc/realloc and pointer ops, ends up with 128 unsafe blocks and about 95.6% coverage, and ships in Redis 8.2.

AI-written summary · about

  1. 0:00Introduction to C to Rust migration
  2. 1:08Redis Query Engine overview
  3. 3:49Incremental rewrite strategy
  4. 6:29Challenges in real-world ports
  5. 6:50TrieMap data structure explained
  6. 11:07C TrieMap memory layout
  7. 13:50Baseline Rust implementation
  8. 17:14Benchmarking the baseline
  9. 18:44Optimized Rust memory layout
  10. 20:24Custom DST in Rust
  11. 22:37Heap allocation in unsafe Rust
  12. 24:58Managing unsafe code safely
  13. 31:07Porting results and takeaways
  14. 33:13Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.