I've been learning how to use Massif, a tool in valgrind for memory profiling. It quickly paid off!
I discovered that difftastic sometimes attempts to preallocate absurd amounts of memory.
miniblog.
Related Posts
A nice side effect of regular profiling: you know which parts of your code are cold.
For example, difftastic's display logic is very cold, so I can do additional linear scans to align content without perf worries!
How to make Rust code faster, including profiling, LLVM whole-crate optimisation, and avoiding costly error checks: https://likebike.com/posts/How_To_Write_Fast_Rust_Code.html
Looking at performance of a new site I've written, and realised I'm slowly serving over 600 KiB of CSS!
I suppose the first set of profiling data is often surprising.
