Re:Improving Rust compile times to enable adoption of memory...
by dmm on Friday February 03, 2023 @10:31AM
(#34642350)
> 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.
Re:Improving Rust compile times to enable adoption of memory...
by dureuill on Friday February 03, 2023 @04:47PM
(#34648176)
i 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?
Re:Improving Rust compile times to enable adoption of memory...
by scns on Saturday February 04, 2023 @04:39AM
(#34653145)
Using mold might help in this case.
`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`.