How I Improved My Rust Compilation Experience
Slow compilation and massive target/ directories — the classic Rust complaints. This post documents the techniques I’m currently using to make things better, using my project ClewdR (an async web service with 394 crate dependencies) as an example. Environment: Rust 1.94.1, CachyOS (Arch-based), NVMe SSD, Btrfs. rust-lld Linking is the final step of Rust compilation, and traditionally the slowest. GNU ld performs terribly here, especially with LTO enabled. The old approach was to manually install lld or mold and configure .cargo/config.toml: ...