Help us benchmark incremental compilation!

Is it only me, or are the instructions missing the measurements for non-fresh non-incremental builds? The number 3. contains all the work for building the crate itself and all the dependencies, and then there’s the incremental stuff, but the non-fresh incremental builds can’t hardly be compared to the full build time, only to the single-crate (dependencies already built) time. I added touching and trivial changes in non-incremental mode as numbers 3.1 and 3.2 to account for this.

I tried compiling the rls crate which I have been playing with lately.

Non-incremental builds

3. rm -rf target && CARGO_INCREMENTAL=0 time cargo +nightly build --release

358.96 real      1126.37 user        40.12 sys

3.1. touch src/main.rs && CARGO_INCREMENTAL=0 time cargo +nightly build --release

81.81 real        80.89 user         0.85 sys

3.2. adding a println! statement and doing CARGO_INCREMENTAL=0 time cargo +nightly build --release

89.60 real        86.64 user         1.57 sys

Incremental builds

4. rm -rf target && CARGO_INCREMENTAL=1 time cargo +nightly build --release

194.50 real      1158.00 user        43.83 sys

5. touch src/main.rs && CARGO_INCREMENTAL=1 time cargo +nightly build --release

8.11 real         7.27 user         0.92 sys

6. adding a println! statement and doing CARGO_INCREMENTAL=1 time cargo +nightly build --release

8.01 real         7.32 user         0.86 sys

I’d like to get a confirmation from @aturon, is missing touch and trivial changes with non-incrementals in the instructions just an omission or is there some reason not to do comparisons/not to be interested with that?

Edit: I almost forgot to say: the incremental builds seem to provide HUGE wins. So big kudos to the implementors! I already said this in twitter, but… wow, I feel this is like unlocking a superpower on Rust!