Hm, the approaches I know of to add inline caches or method caches to ObjC all ended up getting rolled back because they didn’t make things faster enough to justify the code size and memory cost. ObjC is weird though because when you care about perf you just…don’t use objects
-
-
I think the biggest benefit isn’t so much ICs but speculative devirtualization leading to opportunistic inlining, which is really tough without a heat profile of the code (PGO or JIT)
1 reply 0 retweets 6 likes -
Yeah that’s pretty much exactly the problem with ObjC. PGO is of course hard to do well, and people generally manually optimize out the dispatch in known hot paths anyway
1 reply 0 retweets 1 like -
Like, modern CPU’s BTB will mostly do a good job with virtual call overhead. (objc_msgSend is weird but I’m guessing it’s keyed off {pc,lr} on Apple’s chips or something to deal with that.) But inlining, that obviously opens up arbitrarily many optimizations.
3 replies 0 retweets 6 likes -
Which is probably why Microsoft invested so early in PGO. Just the ability to inline IUnknown methods (QueryInterface(), AddRef(), Release()) in COM-heavy code seems huge…
1 reply 0 retweets 0 likes -
How well does Microsoft's profiler-guided optimization work in practice? I know they've done a lot of it but I don't think I know anyone who's ever used it.
1 reply 0 retweets 0 likes -
We use it in Firefox. It’s worth a 10% perf boost or so as I recall
1 reply 0 retweets 1 like -
wait didn't u… write ur own programming language… specifically to write Firefox in
1 reply 0 retweets 0 likes -
This decision predates the use of Rust in Firefox, and there’s a whole lot of C++ still there :) Browser C++ code tends to use a lot more virtual dispatch than necessary (especially Gecko with its XPCOM, though this has improved). It’d probably help less in Rust.
2 replies 0 retweets 2 likes -
Well one place PGO could help a language like Rust (but which supported dynamic unspecialized generic functions) could be to limit generic specialization to hot paths, to avoid template blowup from eagerly generating every necessary specialization
1 reply 0 retweets 1 like
Could also just move cold functions to the end of the binary, which does mostly the same thing except for compilation time.
-
-
Well, the cold functions have to take up storage and bandwidth too…
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.