Testing rustc 1.22.0-nightly (d6d711dd8 2017-10-10) on my lewton project, commit 0d3fc027c8fb7198072a164830709742e7328379, with the command cargo +nightly build --release and RUSTFLAGS='-C codegen-units=16 -Z thinlto' sometimes prepended, sometimes not, in the dev/cmp subdir:
| what | compilation time | benchmark times |
|---|---|---|
| First run no ThinLTO | 37.70s | 3.4114s, 3.4178s |
| First run with ThinLTO | 29.92s | 3.4304s, 3.4247s |
| Second run no ThinLTO | 38.59s | 3.4271s, 3.4571s |
| Second run with ThinLTO | 29.37s | 3.4219s, 3.4747s |
Here, the “benchmark time” is the reported “Overall time spent for decoding by us” in the output of cargo +nightly run --release bench. So a solid >20% speedup in compilation times while the runtime performance didn’t really suffer. Great job!
I’ve also ran a second benchmark, now not compiling the benchmark crate, which pulls in all of hyper and all its dependencies, but compiling only the lewton crate plus its dependencies. cargo +nightly build --release in the main directory of the project:
| what | compilation time |
|---|---|
| First run with ThinLTO | 4.21s |
| First run no ThinLTO | 6.66s |
| Second run with ThinLTO | 4.20s |
| Second run no ThinLTO | 6.66s |
Again, a solid improvement! ThinLTO looks really nice, looking forward to it!