Production Unsafe Rust
summary
Describes when unsafe Rust is justified and how to do it safely: use PEB framework—profile to find real bottlenecks, exhaust safe alternatives, benchmark for order‑of‑magnitude wins—and isolate unsafe to the smallest scope behind safe APIs. Shows Apache Arrow’s scaler buffer that implements zero-copy slicing with alignment checks and ABI encapsulation, deployed in Polars/DataFusion and yielding measured 10–50× speedups; shows Crossbeam’s epoch-based lock‑free memory with formal proofs. Recommends tools: flame graphs, proptest/quickcheck, cargo-fuzz and Miri, heavy testing and code review.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 0:49Unsafe Rust in production
- 2:55PEB framework explained
- 4:21Apache Arrow zero-copy slicing
- 5:47Safety guarantees in Arrow
- 7:54Lessons from Apache Arrow
- 8:39Crossbeam lock-free structures
- 10:03Memory reclamation in Crossbeam
- 11:28Text editor performance needs
- 12:12Why unsafe in text editors
- 13:39Zero-copy buffer operations
- 14:23Isolation pattern for safety
- 15:06Building trust in unsafe code
- 16:32Team knowledge transfer risks
- 17:38Red flags in unsafe code
- 18:40Conclusion and Q&A
related talks
30mEnsuring Rust Safety: Strategies for Managing Unsafe Rust
15mNon-binary Rust: Between Safe and Unsafe
45mBuilding Safe and Secure Systems in Rust
40mWhy Rust?
59mParallel Programming in Rust: Techniques for Blazing Speed
37mRust and Other Interesting Things
59mWhat's the deal with unsafe Rust?
19mCounterexamples in Safe Rust
