It’s hard to believe that devirtualization is never worth it. objc_msgSend is pretty much always a BTB miss and that’s gotta hurt…
-
-
That’s not really true on newer architectures. Branch prediction with history in practice predicts msgSend fairly well
2 replies 0 retweets 2 likes -
Well enough that tricks that increase local code size or memory usage aren’t worth the systemwide costs, at least
1 reply 0 retweets 0 likes -
That would imply that JS inline caches aren't worth it. I'm skeptical, given that it's completely impossible to write a competitive JS engine without them.
3 replies 0 retweets 1 like -
I mean, it seems obvious that you will sometimes benefit from ICs, so the question is only what threshold you want to kick in the optimization at (via PGO), not whether you should do it at all.
1 reply 0 retweets 0 likes -
Profitable PGO thresholds are one problem. Another problem is that PGO and the associated performance measurement and feedback apparatus is not yet solved, as far as I know.
1 reply 0 retweets 0 likes -
Culturally I think ObjC programmers also tend to hand-optimize the hot parts of their code, either by not using messages at all or manually caching IMPs
2 replies 0 retweets 6 likes -
Yep. People forget the Objective-C is a hybrid language, and the idea is to have fairly coarse-grain Software-ICs implemented in C, connected via message-sends. Also, object allocation, call/return style and keyed-accessing in all its forms are magnitude(s) worse than msg-send.
2 replies 0 retweets 3 likes -
Unfortunately the community got saturated with C++/Java people who never grokked that idea. Thus we have Swift.
1 reply 0 retweets 1 like -
Though admittedly the Smalltalk folks also don't really get the hybrid model. And of course a "pure" programming model is attractive for many reasons. I think applying OO-techniques to our language meta-model actually allows us to have the best of both worlds.
2 replies 0 retweets 0 likes
Note that ICs were developed as the solution to this problem in Self/Smalltalk. They’re pretty much the only way to make dynamically typed virtual dispatch fast.
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.