~/talk

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

Talkat Oxidize 2025 · 2025-09-16..09-18· [rust]
links:none on file
slides:none on file

Ported a C TrieMap used inside Redis’ query engine (the C codebase is ~63,000 LOC) into Rust, starting with a simplified baseline, adding microbenchmarks and FFI tests, then reimplementing a packed, single-allocation node layout using manual alloc, pointer metadata and custom DST-like handling. Resulting Rust module grows from ~1,000 C lines to ~1,900 Rust lines, uses single heap allocation layout, contains 128 unsafe expressions across 21 private unsafe methods but keeps unsafe <10% of code, achieves 96% test coverage, and matches or outperforms the original with only a few percent extra memory.

AI-written summary · about

  1. 0:00Introduction and context
  2. 0:54Migration strategy
  3. 2:39Module graph and trie maps
  4. 4:28Data structure challenges
  5. 7:33Baseline and initial results
  6. 10:42Implementing the final version
  7. 13:58Managing unsafe code
  8. 18:25Results and conclusion
  9. 20:02Q&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.