-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 unnecessary work in finalize_resolutions_in
.
#98569
Conversation
This is a 1% win on the |
I'm not super familiar with the resolver, and the change seems OK, but I wonder if this could impact resolutions to the modules where it's done lazily, e.g. their possible errors / ambiguities ? I would trust tests (esp with r=me if that's the case, and if we ever need this PR to be easy to find for bisection: @bors rollup=never |
The idea here is that functionality shouldn't be changed. The current code creates I just rearranged things so that That's why I asked a non-resolve-expert for the review, because it's just a minor code rearrangement :) |
To clarify, I meant that rust/compiler/rustc_resolve/src/lib.rs Lines 550 to 560 in 8308806
rust/compiler/rustc_resolve/src/lib.rs Lines 1658 to 1664 in 8308806
|
r? @cjgillot |
If `module.opt_def_id()` returns `None`, we can skip most of the work.
4fe2967
to
0e475b5
Compare
finalize_resolutions_id
.finalize_resolutions_in
.
Nah, only modules from other crates are lazily populated, and the less of them is populated the better. |
@bors r+ |
📌 Commit 0e475b5 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5f98537): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
Slightly unexpected perf results, but the wins and losses more or less balance out so I don't think we need to worry about it. @rustbot label: +perf-regression-triaged |
If
module.opt_def_id()
returnsNone
, we can skip most of the work.r? @lqd