If you put me in charge of objc_msgSend, I think I’d have the compiler scatter a couple of polymorphic inline caches into the binary at each call site (using indirect jumps to satisfy W^X). I think it’d reduce insn count from 11 to ~6, and it would use the BTB better.
-
-
That’s not really true on newer architectures. Branch prediction with history in practice predicts msgSend fairly well
-
Well enough that tricks that increase local code size or memory usage aren’t worth the systemwide costs, at least
- 8 more replies
New conversation -
-
-
In practice we usually use human-assisted PGO (we look for hotspots and rewrite them in C)
-
I mean, sure, but compilers are there for a reason, right? :)
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.