Improving Rust Performance Through Profiling and Benchmarking
summary
Compares concrete tooling and measurements: uses cargo bench, perf + flamegraphs, Instruments and VTune to profile a Rust TCP proxy and a stats lib called taco; shows a multi‑threaded macro benchmark that initially has IPC ≈0.5, L1 miss rate ≈5% and 9s runtime, pins threads to sockets and drops misses to ≈0.01% while cutting runtime to 9s → 3.8s and raising IPC ~10%, and flags common Rust pitfalls like excessive Clone, crypto hashes, and expensive argument evaluation.
AI-written summary · about
chapters (14)
- 0:00Start
- 3:11MEMORY HIERARCHY LATENCY GUIDELINES
- 3:59CPU UTILIZATION
- 5:52DEFAULT HASHER IN THE STANDARD HASHIMAP
- 6:34EXPENSIVE ARGUMENTS TO expect()
- 8:06CARGO BENCH
- 9:31HOW TO CONSTRUCT A MACROBENCHMARK
- 11:37BASIC CPU ARCHITECTURE
- 13:04INTEL PERFORMANCE COUNTERS
- 13:42INSTRUCTIONS PER CYCLE
- 17:52PERF CACHE MISSES/HITS
- 23:51VTUNE TAKEAWAY
- 24:17LESSON LEARNED
- 25:43TAKEAWAYS
related talks
31mBenchmarking and Optimization of Rust Libraries
24mRust performance debugging with TUIs and LLMs
59mParallel Programming in Rust: Techniques for Blazing Speed
26mAllocating Less: Really Thin Rust Cloud Apps
33mRust at Sentry: 7 Years Later
23m"The Current State and Future of Rust Compiler Performance"
27mThe Wonderful World of Rust Tooling
56mReady for Rust
