Cutting Rust incremental build times from 40s to 6s with linkers, Cranelift and caching
A team maintaining an 80k-line Rust workspace of 14 crates found a single-line incremental rebuild took 40 seconds, a delay that multiplied quickly when AI agents repeatedly edited and tested code. The article recommends measuring first with cargo's timing report and rustc's time-passes flag rather than guessing at fixes. It explains that Rust 1.90 made lld the default linker on x86_64 Linux, while mold 2.x remains an option on other targets. Cranelift, a faster but less optimized code generator suited to dev builds and tests, is proposed alongside caching dependencies with LLVM at opt-level 2, which reportedly cut the incremental build to about 14 seconds.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in