top | item 34273501

(no title)

strager | 3 years ago

> A recent change[0] on nightly rustc might help with incremental builds.

I tested with rustc Git commit c7572670a1302f5c7e245d069200e22da9df0316, which (I think) includes that change.

> And for repeated clean + full build cycles there's sccache[1].

You're right. I included full builds in the article because almost-full builds happen a lot in C++ (after common certain header files, or if you think the build system broke something).

I imagine almost-full builds rarely happen when working in Rust though, so maybe I should have deemphasized my full-build benchmarks.

discuss

order

laund|3 years ago

Rust by default only does a full build really rarely. Ive gone through days, even weeks, of working on a project without a full build.

Partial builds are of course way faster, especially if you use many dependencies (i know you don't). I mainly work with the bevy game engine in Rust, which has a lot of dependencies. Even if i don't use its dylib feature, i get 2-3s compiles. And that's on a project with multiple hundreds of thousands LoC when you include dependencies. With dylib, it goes down to 0.5-1 second builds.

If your main conclusion is based on full builds, i would urge you to re-evaluate. The normal experience is just "cargo run" which rarely does a full build.

berkut|3 years ago

I've got a ~9k loc Bevy "game" I'm writing that doesn't use dylib and takes > 20 secs every update, purely because of the linking (I'm not using mold yet, but am using lld)...

i.e., I type 'cargo build', it compiles the single .rs I changed almost instantly, but then I'm staring at:

Building [=======================> ] 314/315: landscape(bin)

for the next 20 seconds.

strager|3 years ago

> If your main conclusion is based on full builds, i would urge you to re-evaluate.

It's not. I show several charts comparing incremental builds too.

nicoburns|3 years ago

Yeah, I pretty much only do a clean build when I update the compiler. Or when I’m tweaking the build configuration itself.