Optimising stable sort in Rust and mostly failing
summary
Porting a promising C sort (fluxsort) to Rust yields a concrete story: a copied slice::sort implementation, a battery of tests and Criterion benchmarks with fixed seed and rand, and many concrete failures — off‑by‑one and type‑conversion bugs, a seed mistake that repeats inputs, and a uniqueness‑preservation panic‑safety issue that causes surprising observable duplicates. Benchmarks report impossibly low counts (about 3 comparisons for 10 random elements), changes land in thousands of lines of code, and the improved sort often fails to keep its promises.
AI-written summary · about
chapters (11)
- 0:00Optimising stable sort in Rust
- 1:26About the speaker
- 2:07Initial expectations
- 4:14Porting errors
- 6:44Testing methodology
- 11:42Benchmark correlation
- 12:26Benchmark design
- 17:47Uniqueness preservation issue
- 26:55Conclusion
- 27:16Embracing mistakes
- 29:02Resources
related talks
31mBenchmarking and Optimization of Rust Libraries
57mA Long Journey of Changing std::sort Implementation at Scale
33mRewrite, Optimize, Repeat
40mRust’s approach of getting things right
25mIntro and Overview to Rust
37mRust and Other Interesting Things
58mRust for The Curious C++ Developers
01h 02mRewriting of a small component from C to Rust
