4 ms·
Incremental builds are what matter to me. On my 1240p if I change one file and build it takes ~11s to build. Changing one file and running tests takes ~3.5. Tha
by dmm 4y ago
Incremental builds are what matter to me. On my 1240p if I change one file and build it takes ~11s to build. Changing one file and running tests takes ~3.5. That's all build time the tests run in <100ms.
The incremental build performance seems to be really dependent on single-thread performance. An incremental build on a 2014ish Haswell e5-2660v3 xeon takes ~30s.
- kibwen 4y ago> On my 1240p if I change one file and build it takes ~11s to build. Changing one file and running tests takes ~3.5 `cargo test` and default `cargo build` use the same profile, so presumably the first number is referring to `cargo build --release`. Release builds deliberately forego compilation speed in favor of optimization. In practice, most of my development involves `cargo check`, which is much faster than `cargo build`.
- dmm 4y ago> so presumably the first number is referring to `cargo build --release` Both numbers are for debug builds. I don't know why `cargo test` is faster but I appreciate it. Incremental release builds with `cargo build --release` are even slower taking ~35s on the 1240p.
- dureuill 4y agoi suspect most of that time is link time. Possibly the linker in use is not very parallel, and so linking one big executable with cargo build takes longer than many smaller test executable whose linking can actually be made parallel?
- scns 4y agoUsing mold might help in this case. https://github.com/rui314/mold https://github.com/rui314/mold https://github.com/rust-lang/rust/issues/94347 https://github.com/rust-lang/rust/issues/94347
- kibwen 4y agoHonestly, it should be impossible; in the absence of some weird configuration, cargo test does strictly more work than cargo build. :P Can you reproduce it and file a bug?