The Impact of Memory Allocators on Performance: A Deep Dive
summary
Benchmarks use Criterion on bare-metal VMs and CutSpeed for noisy measurement and show concrete wins: jemalloc and mimalloc outperform the default allocator by up to 3× faster on certain workloads, while a bump allocator is dramatically faster for many tiny allocations but inflates memory footprint. Results include a 128-byte concurrent test that exposes poor scaling for one allocator and a 5–25 MB randomized test keeping 20 live blocks to reveal fragmentation and throughput tradeoffs.
AI-written summary · about
chapters (14)
- 0:00Memory allocators intro
- 2:53Why allocation is necessary
- 4:25Rust memory types
- 8:56Heap memory and allocators
- 13:17Custom allocators in Rust
- 17:55Building a bump allocator
- 21:10Allocator design challenges
- 23:22Production allocators overview
- 24:27Benchmarking allocator performance
- 27:35Concurrent allocator performance
- 28:17Large allocation benchmarks
- 29:23When to use bump allocators
- 30:04Choosing the right allocator
- 30:26Performance tricks
related talks
01h 03mTaming dynamic memory
26mAllocating Less: Really Thin Rust Cloud Apps
05mWhen every Microseconds counts: Lessons learned about performance
37mTrack your memory allocation
56mC++ Relocation - How to Achieve Blazing Fast Save and Restore and More!
05mInterview
57mDynamic memory allocation challenges in safety critical systems
29mWrangling memory leaks where you thought they could never happen
