It's wonderfully easy to switch out the allocator in Rust: https://doc.rust-lang.org/edition-guide/rust-next/no-jemalloc.html
Sadly it didn't help difftastic performance despite doing a lot of allocation, but it's really easy to try it!
miniblog.
Related Posts
An AI benchmark website that tries to run comparable benchmarks regularly to discover when LLM performance is degrading:
When writing long-lived programs (daemons etc) in Rust, I find myself asking *where* I should put data.
In a GC'd language it's just "I have a string" but Rust forces me to find somewhere to put it.
You do get a performance benefit for this work though.
I've just squeezed another 5% of performance out of difftastic by finding a few HashSet values that weren't FxHashSet.
I do wonder whether hash DoS resistance is a good default. Sure, Rust programs are often pretty fast anyway, but it feels like a different threat model to the rest of Rust.