-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Resolve tweaks #132761
Resolve tweaks #132761
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Resolve tweaks r? `@ghost`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (4e79a44): 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 the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 1.3%)This 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.
CyclesResults (secondary 7.9%)This 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 780.076s -> 781.343s (0.16%) |
`to_lowercase` allocates, but `eq_ignore_ascii_case` doesn't. This path is hot enough that this makes a small but noticeable difference in benchmarking.
This gives a small but noticeable performance improvement.
8e22596
to
e3caff5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@petrochenkov: I was going to request a different reviewer because (a) I know you are busy, and (b) none of these changes involve any resolver-specific expertise. But you can review if you want. |
I can take a look. r? jieyouxu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, one tiny nit regarding a bool
param for a fn that has multiple params that looks confusing at call-sites. But otherwise, this looks like a nice cleanup!
Yes, I self assign if I want to review, or at least take a look. |
(My bad I didn't notice it) |
In this case field access is more concise and easier to read than destructuring, and it matches how other similar loops are done elsewhere.
`for_each_child` exists for this exact pattern.
Instead of a string comparison.
`resolve_ident_in_module` is a very thin wrapper around `resolve_ident_in_module_ext`, and `resolve_ident_in_module_unadjusted` is a very thin wrapper around `resolve_ident_in_module_unadjusted_ext`. The wrappers make the call sites slightly more concise, but I don't think that's worth the extra code and indirection. This commit removes the two wrappers and removes the `_ext` suffixes from the inner methods.
This path isn't hot enough for this to affect performance, but there's no point repeating the same computation multiple times.
It makes the code clearer.
It was added in rust-lang#115367 for anonymous ADTs. Those changes were then reverted in rust-lang#131045, but `empty_disambiguator` was left behind, perhaps by mistake. It seems to be unnecessary.
e3caff5
to
12747f1
Compare
I have updated. I removed one old commit (the one updating the comment on |
@rustbot ready |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ee612c4): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -0.5%, secondary 3.0%)This 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 793.886s -> 795.801s (0.24%) |
A couple of small perf improvements, and some minor refactorings, all in
rustc_resolve
.r? @petrochenkov