Rust level optimizations sound promising. I could not find a good high level explanation what inlining means in this context and how it facilitates Rust level optimizations.
I think inlining is function inlining, which is an optimisation that lots of compilers do. The change here is to move (some of) that earlier in the compilation process (in the "middle end" of the Rust compiler rather than in the LLVM backend), which can make things more efficient by reducing the total amount of work that needs to be done.
The reason it's so important is that inlining synergises with other optimizations, its often run before or after other passes like constant propagation. Consider something like:
fn add(x : usize, y : usize) -> usize { x + y }
fn main() {
add(5, 1)
}
Without inlining we can't easily optimize the code of `main`. However, if we inline `add` into main, constant propagation will then directly see `5 + 1` and optimize that into `6`.
I've read
https://rustc-dev-guide.rust-lang.org/mir/index.html
and
https://blog.rust-lang.org/2016/04/19/MIR.html
but both did not enlighten me regarding inlining. Could you ELI5 or point me to relevant documentation?