Exploration of build times
Cargo in nightly has a -Z timings
option since September - thanks to @pborelli for pointing this out.
I have a somewhat old i7-3770 @ 3.40 GHz.
With rustc 1.40.0-nightly (aa69777ea 2019-10-29)
, I just got these timings for cargo build -Z timings
in the toplevel, no "make". Each is after "cargo clean"; times in seconds.frac. Cargo outputs the total time in min:sec; I converted it to sec.frac.
cargo build
mode total time rsvg_internals librsvg_c_api librsvg
-------------------------------------------------------------------------------
debug 80.0 10.0 1.4 0.7
--release 194.0 15.7 48.3 0.5
--release, no lto 149.0 15.6 2.2 0.5
--release, no lto, no debug 123.0 13.0 1.8 0.5
Next, /usr/bin/time cargo test -Z timings
in the toplevel, after "cargo clean". Cargo doesn't output the test times; that's why I wrapped this in /usr/bin/time. I'm not including the individual crate timings since they have two values, one for the normal build and one for the test build. I don't know yet how to make sense of those :)
cargo test
mode total time
----------------------------------
debug 93.4
--release 973.2 (and swapped out lots of stuff?)
--release, no lto 261.0
--release, no lto, no debug 207.4
Next up, running the full "make check".