-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Removing the def_id field from hot ParamEnv to make it smaller
#76244
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
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jackh726 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
71cb92b to
6f44404
Compare
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
6f44404 to
0d7ab10
Compare
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.
What would you think about changing this list (which is also a duplicate) to a _ pattern?
0d7ab10 to
047f03f
Compare
d88ca38 to
db6b482
Compare
|
Also, seems like one of the test outputs changed, so you'll have to |
nikomatsakis
left a comment
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.
This looks great! Nice work. I left two nits about naming, but otherwise I'm happy.
compiler/rustc_ty/src/ty.rs
Outdated
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.
can we add a doc comment to this fn? it's pretty non-obvious to me what it does from its name. Actually, I suspect the name should just be improved to something like well_formed_types_in_env
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.
/// Elaborate the environment.
///
/// Collect a list of `Predicate`'s used for building the `ParamEnv`.
///
/// Used only in chalk mode.
@jackh726 anything to add?
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.
Perhaps mention that this adds TypeFromEnv (or what the eventual name ends up being) predicates. Specifically, because these types come from the environment, we assume they are well formed.
|
@bors try @rust-timer queue |
|
Awaiting bors try build completion |
|
⌛ Trying commit 8f39a0415a6ca789a18c9d3bbbba43b5fda542bd with merge 5ef250dd2ad618ee339f165e9b711a1b4746887d... |
|
@bors r=nikomatsakis |
|
📌 Commit 7dad29d has been approved by |
|
☀️ Test successful - checks-actions, checks-azure |
|
It looks like this was a pretty major wall-time regression (up to 25%). There were some ~1% improvements too, but this regression seems to outweigh those. It looks like that was mostly in match checking, which is somewhat surprising -- there doesn't seem to be significant modifications to that code in this PR. I suspect we'll want to revert as this is a pretty big regression, but it would be useful to try to analyze where the instruction diff is coming from. |
|
@Mark-Simulacrum that's really strange, not what I would expect at all. Seems those 2-3% regressions in instruction count for unicode_normalization are pretty significant. I wonder if the additional |
|
Ah, I missed that there's two things being done here -- would've been good to split that into separate commits perhaps. @vandenheuvel do you think you could prepare a PR that reverts this one, and then just adds the PredicateAtom variant as @jackh726 suggests? |
|
@Mark-Simulacrum in hindsight, yeah, splitting into two makes sense. But given that we didn't expect a perf regression (since we were more focused on the removal of If @vandenheuvel can't, I can try to make a PR this weekend for perf. |
|
No worries! Yeah, we'll check in on this next week's perf triage (roughly Tuesday) but it's no big deal if it takes some time. |
|
Hi! This PR showed up in the weekly perf triage report. It resulted in a small improvement across the board in instruction counts. However, some benchmarks, notably Seems like this is already being looked into. Thanks all! |
|
@ecstatic-morse this issue is now picked up in #77058. |
This PR addresses #74865.