DEV Community

loading...

Discussion on: Performance Comparison, Rust vs Crystal with Redis

Collapse
tamas profile image
Tamás Szelei

LTO stands for link-time optimization, which is a great feature of LLVM (thus, rustc). You can enable it in your Cargo.toml:

[profile.release]
lto = true

The above will make --release builds use "fat" LTO, meaning all dependencies and the project itself is link-time optimized (you could set it to "thin" which means LTO is only applied to the current crate).

Another option to go even further is PGO, but that is a bit more involved and I haven't tried it with rust. Here is some documentation if you are interested: doc.rust-lang.org/rustc/profile-gu...

Combining both can go pretty far in optimizing performance.