I propose to add a book about optimizing Rust code to the bookshelf.
I was recently adding a comment to an issue that asks for more documentation about LTO, ThinLTO and Co.. The issue raised the question where this kind of documentation needs to go. While thinking about it, I realized there is no appropriate place in the bookshelf:
- “The Rust Programming Language”: wrong experience level (beginner instead of intermediate)
- “The Cargo Book”: wrong topic
- “The Unstable Book”: wrong topic
- “The Rustonomicon”: the closest we can get, but also wrong topic
- “The Reference”: wrong topic
- “The Rustdoc Book” wrong topic, again
LTO, ThinLTO and Co. are clearly about optimizing Rust code. Therefore, such a book would be nice to have.
When thinking about optimization and performance, more topics come into my mind:
- Multithreading, including Rayon and Futures
- SIMD, including faster and the work currently done in the compiler and the standard library
- Zero cost abstractions in general: How do they compile down to super-fast bytecode? What to do? What to avoid?
- Compiler optimizations in general: What can/can’t the compiler optimize?
- How to benchmark? What tools are available?
A book about optimization and performance would be documentation at intermediate level. This is exactly what the 2018 Roadmap asks for!
Details design, drawbacks, etc.
To be done… I would like to hear feedback first!
Edit: A good name for a book on optimizing Rust might be “Thrust”…