Closed Swatinem closed 10 months ago
Merging #1337 (7d6b2ae) into master (8f3a697) will decrease coverage by
0.01%
. The diff coverage is100.00%
.
If building time is important, I can suggest a trick with creating an additional Cargo profile (let's call it profile.release-lto
) and build it not per every commit but maybe per release or something like that.
Here are some examples:
Another positive outcome from enabling LTO is reduced binary size (however for Symbolicator it shouldn't be a critical advantage).
~640s of linking time
Regarding linking time. I can suggest you switch to LLD or even the Mold linker. Here are some benchmarks between Gold vs LLD vs Mold.
If you decide to use LLD and want to optimize the CI pipeline as much as possible, I can suggest recompiling LLD with PGO - the results can be found here.
@Swatinem also I can suggest enabling LTO for other Sentry projects like https://github.com/getsentry/relay
Related to https://github.com/getsentry/symbolicator/issues/1334 CC @zamazan4ik
This is so far just doing the first step, using 1 CGU and LTO to optimize the compiler output, without relying on instrumentation and gathering profiling.
Using cargo
--timings
, I get local bound times of ~260s of Rust build + ~640s of linking time (LLVM does code generation at link time with LTO if I understand things correctly) for a total of ~15 minutes.The first part we can mostly solve with dependency caching, but not the last linking step. So our docker builds will most likely take in the order of 10 minutes.
I would actually like to land this and maybe let it run over the weekend in a canary, so we can compare that to the baseline.
skip-changelog