-
Notifications
You must be signed in to change notification settings - Fork 13.9k
obligations_for_self_ty: skip irrelevant goals #146759
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
base: master
Are you sure you want to change the base?
Conversation
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor changes to |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
obligations_for_self_ty: skip irrelevant goals
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
obligations_for_self_ty: skip irrelevant goals
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (ba651ad): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (secondary -3.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 470.95s -> 473.304s (0.50%) |
| let sub_root_var = self.sub_unification_table_root_var(self_ty); | ||
| let obligations = self | ||
| .fulfillment_cx | ||
| .borrow() | ||
| .pending_obligations_potentially_referencing_sub_root(sub_root_var); |
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.
comment
|
Is this like, important, or is it "just" a small perf win? |
452fdbf to
9926fa3
Compare
|
@rustbot ready see pr descr |
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.
I feel relatively uneasy about this. I don't like that this optimization makes obligations_for_self_ty wrong if try_evaluate_obligations hasn't been previously called in order to update all the stalled_on vars.
If this were only a theoretical issue it'd still be pretty bad since I don't think we'd be able to expect it to not happen in practice in the long term. In practice it should be possible for unsize coercion to hit this with its custom obligation evaluation loop and inability to call try_evaluate_goals.
I think the only way I could approve this if I thought it was ok to have obligations_for_self_ty have incorrect behaviour in some edge cases and I think that is not the case.
I'm not sure what the right fix is here given that unsize coercion does actually hit this in theory, so asserting that we're always calling obligations_for_self_ty in "good" cases doesn't actually work ^^'
It is totally okay for |
Reduces the compile time of
wg-grammarfrom more than 70s to about 40s. So a >30% perf improvement for that crate.r? @BoxyUwU @compiler-errors