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 -
Yeah, I was thinking this too. JS has more extreme demands on performance because devirtualization is necessary to call most anything. In Obj-C (and Swift), direct calls are more idiomatic for perf-critical code.
1 reply 0 retweets 2 likes -
I still think PGO would result in wins, but I can understand it being lower priority than in JS.
1 reply 0 retweets 0 likes -
Like
@gparker said, the main issue with PGO is the workflow problem of collecting and maintaining good profile info, which AFAIK still hasn’t really been solved well.1 reply 0 retweets 1 like
Yup. We used to have problems with MSVC PGO causing *address space* exhaustion on 32-bit build machines :)
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.