-
Notifications
You must be signed in to change notification settings - Fork 352
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
Iterate in reverse when comparing Stacks #2214
Conversation
Thanks, this makes sense! Bummer that we don't have perf tracking infrastructure... I'll just trust that this works. |
We could also wait for @Nilstrieb to confirm that this is at least as impactful as they optimization they were considering. |
6c22b22
to
f8c422f
Compare
Well, have you tested this PR and confirmed that it helps on some benchmarks? |
Hmm, that is interesting. Running the
|
Even more interesting, I ran the
|
Optimize `SbTag::eq` The code before generated really bad code with a branch. This nudges LLVM towards being smarter and simply comparing the integers. See #2214 (comment)
So on its own this seems to make it worse, if it has an effect at all. |
Rebasing the two and comparing them with master again
|
Based on some experimentation I just did on my end, I think the thing to do here is land a few of my local test cases as |
I'll re-open this if it still seems interesting after making all the decisions on #2315 |
Since #2315, the stack comparison code path is now optimized to a |
I was originally going to propose this after I (eventually, sorry) am done with #1935 but @Nilstrieb independently identified this code path as hot and came up with a different optimization, which is basically this: rust-lang/rust#49892 (comment)
Anecdotally, I've found this optimization to be much more effective but of course that is probably workload-dependent.