-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
add a fastpath to match_impl for the non-HRTB case #36931
Conversation
☔ The latest upstream changes (presumably #36953) made this pull request unmergeable. Please resolve the merge conflicts. |
this leads to a 1.5% all-around typeck time improvement
this does not have a measurable performance effect and mostly makes the logs clearer
a10d388
to
9a6776f
Compare
@@ -2668,6 +2668,49 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { | |||
} | |||
} | |||
|
|||
fn match_impl_fastpath(&mut self, |
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.
Hmm. I'm not thrilled about the duplication, though the perf win is nice.
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.
That's about the smallest amount of code you can duplicate ;-).
this improves typeck performance by another 1%
9a6776f
to
13ca54d
Compare
Perf differences over just shortcutting
Small but solid. OTOH, maybe small enough we should just shortcut |
r=me |
Hmm. So I think the changes are ok, but I agree these gains are not very large. |
@arielb1 after having let this sit for a bit, my take is that given the minimal gains and the code duplication that was introduced, this is maybe not worth it. What do you think? |
Sure. I have an idea for a better improvement too - just need to get to it. But at least the shortcut- |
This leads to a 2.5% all-around typeck time improvement.
e.g. librustc times before:
at the first commit:
at the third commit:
r? @nikomatsakis