Enable LTO for rustc_driver.so#101403
Conversation
|
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
|
@bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
|
⌛ Trying commit d3365e41c4520a61804dbf8bdc1501523b90b7ad with merge af5e9125d450e00077d4680e4e02685ba33e9f8e... |
This comment has been minimized.
This comment has been minimized.
|
☀️ Try build successful - checks-actions |
|
Queued af5e9125d450e00077d4680e4e02685ba33e9f8e with parent c2d140b, future comparison URL. |
|
Finished benchmarking commit (af5e9125d450e00077d4680e4e02685ba33e9f8e): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
|
This will need to add a check that the dependency formats match for all crate types. Otherwise LTO might think it needs to link in a crate at LTO time when compiling, but one of the crate types would link in a dylib containing the crate, giving duplicate symbols, or the other way around. |
|
cc @Kobzol |
|
We have actually been discussing this with bjorn3 😅 But thanks! |
|
Regarding the perf. results:
Overall, I think that it's a great result. The RSS hit is unfortunate, but I think that it's worth it to take it for ~5-10% improvement on real world crates. Using LTO could also remedy some of the issues with small functions not being inlined and requiring manual It remains to be seen if there will be some problems with it. One thing that comes to mind is whether LTO won't make perf. swings more common (i.e. modifying a small part of code could produce large perf. changes because of LTO instability), but we have to test that in real usage I suppose. Also I wonder if we should print some warning or bail completely for now if LTO for dylibs is used outside of |
This comment has been minimized.
This comment has been minimized.
|
This PR implements LTO for the |
This comment has been minimized.
This comment has been minimized.
|
Hi, I've seen you changed some diagnostic structs in your PR. After #103345, the way we refer to fluent messages changed. They are now in a flat namespace with the same identifier as in the fluent file. For example, |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (1ca6777): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
|
Looks like this possibly caused #103538 |
Alternative to #97154
This enables LTO'ing dylibs behind a feature flag and uses this feature for compiling rustc_driver.so.