-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Don't loop if there are no pending obligations #144475
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 |
@bors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Don't loop if there are no pending obligations
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (3684df7): 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)Results (primary 2.8%, secondary -1.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.1%, secondary -3.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 468.925s -> 466.162s (-0.59%) |
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.
The fact that this is a perf improvement is wild to me and seems to indicate a larger opportunity.
If we don't bail eagerly, we call drain_pending(|_| true)
which is just mem::take(&mut self.pending)
and then drops the Default
ThinVec
again.
How hot are the different parts of this function?
- entry
- initial loop
- encountering 1 or more goals (if so, how many)
- more than 1 loop
I remember that in the old solver, we do the stalled_on
check and then the actual fulfillment happens in an #[inline(never)]
function.
I can imagine doing the same here and outlining the stalled_on
check. I would generally like to know whether fulfillment ends up being pretty much just as hot as in the old solver 🤔
Another microoptimization. Let's see.
r? lcnr