On distributary, a research prototype of a caching database:
$ cargo clean -p distributary
$ env | grep -i RUSTFLAGS
RUSTFLAGS=-C link-args=-fuse-ld=gold -C target-cpu=native
$ cargo b --features=binaries --bin=vote --release
...
Finished release [optimized + debuginfo] target(s) in 333.32 secs
$ target/release/vote -r 30 -q --avg --stage | tail -n2
avg PUT: 852343.09
avg GET: 2021065.57
$ cargo clean -p distributary
$ env RUSTFLAGS="$RUSTFLAGS -C codegen-units=16 -Z thinlto'" \
cargo b --features binaries --bin vote --release
...
Finished release [optimized + debuginfo] target(s) in 232.18 secs
$ target/release/vote -r 30 -q --avg --stage | tail -n2
avg PUT: 827089.96
avg GET: 1884244.87
This is with a 4-core (8 HT) Intel® Xeon® CPU E3-1240 v5 @ 3.50GHz. Ran the same thing again and got approximately the same results.
So, compile time decreased by ~30% (\o/), runtime performance decreased by 3% for one benchmark (PUT; relatively complex) and 7% for another (GET; basically just hashmap lookups). Good work!
EDIT: For completeness, ThinLTO without ld.gold compiles in 229s (so faster than with ld.gold!), and neither ThinLTO nor ld.gold compiles in 334s (so marginally slower than ld.gold). Maybe it’s time to ditch ld.gold from my RUSTFLAGS
…?