-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Check likely/unlikely hinting #5309
Comments
I'm not super convinced this is something we can do a lot with, and seems better left for the JIT team? |
I'm not super optimistic that they're going to be able to do much with it either. There are somewhere around 860 of them under hphp (and more littered elsewhere in dependent libraries), and the only thing we know for sure is that removing all of them is a regression. The effect of any one of these would be unlikely to be measurable, and nearly all of them were placed based solely on intuition. |
Doing something completely unrelated, I came across this in the Linux kernel: https://github.com/torvalds/linux/blob/v4.0/include/linux/compiler.h#L111-L136 Basically, we could make our |
I like this idea! |
If you don't mind, I still think this is worth doing, unless it's been done internally (which I wouldn't have heard about)? I may come back to it at a hackathon or something for fun. |
I just went through and closed all of the lockdown issues, which is where this came from :P |
There are some automated tools that, with some modification, would do this far better and easier than manual review, so this is a task best discussed internally. |
Measure branch prediction and cache line packing effects of the LIKELY() and UNLIKELY() macros in HHVM sources to ensure these are providing the correct predictions. There are a lot of these (~2000) so this could take a long time to do. (This may be too tedious to do during lockdown).
The text was updated successfully, but these errors were encountered: