-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid nondeterminism in trimmed_def_paths #89408
Conversation
Previously this query depended on the global interning order of Symbols, which meant that irrelevant changes could influence the query and cause recompilations. This commit ensures that the return set is stable and will not be affected by the global order by deterministically (in lexicographic order) choosing a name to use if there are multiple names for a single DefId.
(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 56fcf07 with merge bde948fea1e2e10b64d5edf9ca9c1aba01f2da10... |
(Nondeterminism is maybe not the right name -- a specific compilation should always be the same. But "irrelevant" changes can cause the behavior of this query to differ, which seems not great). |
☀️ Try build successful - checks-actions |
Queued bde948fea1e2e10b64d5edf9ca9c1aba01f2da10 with parent 6dc08b9, future comparison URL. |
Seems like a good idea. Outside the scope of this, but it might be nice if trimmed paths in error messages used the most appropriate name when there are multiple possibilities, taking into account any |
Finished benchmarking commit (bde948fea1e2e10b64d5edf9ca9c1aba01f2da10): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 led to changes in compiler perf. @bors rollup=never |
This indeed seems to fix the performance regressions we saw previously! 🎉 |
@bors r+ |
📌 Commit 56fcf07 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (edebf77): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Previously this query depended on the global interning order of Symbols, which
meant that irrelevant changes could influence the query and cause
recompilations. This commit ensures that the return set is stable and will not
be affected by the global order by deterministically (in lexicographic order)
choosing a name to use if there are multiple names for a single DefId.
This should fix the cause of the regressions in #83343.