-
Notifications
You must be signed in to change notification settings - Fork 361
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
move checking ptr tracking on item pop into cold helper function #2328
Conversation
@saethlin do you think this makes sense, or should we close the issue without further action? |
I think that micro-optimizations like this should wait until #2315 lands, especially because that makes other changes in this function. |
☔ The latest upstream changes (presumably #2315) made this pull request unmergeable. Please resolve the merge conflicts. |
Rebased after @saethlin 's PR landed, and found another cold path in the same Before:
After:
This is just on the edge of 1-2σ most of the time, but seems fairly clear on slice-get-unchecked (6% faster). Strangely it seems like a 2σ regression on unicode. So overall my inclination is to land this? I can't see how it could hurt, anyway... |
Hm, give me a bit to twiddle with this... |
Oh yeah this is perfect, I'm not surprised this is ~perf neutral on most functions and shows the most effect on slice-get-unchecked, because that benchmark stresses this code path more than anything else. A 2σ regression could easily be noise due to the scheduler or some minor perf effect we don't have control over. |
Should we add |
I think that Ideally LLVM could extract cold paths into functions via PGO but I've never seen that happen. And unlike profile data we know what paths are guaranteed to be cold, as opposed to where we just don't have good profiles yet. |
Okay, fair. I thought Thanks for the review! |
☔ The latest upstream changes (presumably #2369) made this pull request unmergeable. Please resolve the merge conflicts. |
It does add an inlining hint, but the hint is small, and some people including me and some people in LLVM keep wanting to get rid of it (most notably on C And the fact that it adds a hint I think means that it would be worse to add in a situation like this. What I would really like is a |
☀️ Test successful - checks-actions |
Before:
After:
Nothing major, but we'll take it I guess. 🤷
Fixes #2132