Apple’s A15 chip will ship with an objc_msgSend branch predictor
twitter.com
twitter.com
Comment near start says:
/// Code for setting up the H14 ObjC branch prediction control registers.
The only static indirect jump hints I'm aware of, and Intel uses this, is next instruction. Unless it's in the BTB, the default speculated indirect jump target is the next instruction. This means the programmer should make the most common target follow the indirect jump instruction itself. See Assembly/Compiler Coding Rule 50 in the Intel® 64 and IA-32 Architectures Optimization Reference Manual
Do those get optimized now? As far as I know, objc_msgSend was never optimized out (as of a few years ago when I was doing iOS dev) because any method can be swizzled and replaced at runtime.
However, what I was to was that you can store the method in a variable, and call it directly, thus bypassing objcMsgSend.
:)
(Not to mention that even pure-Swift apps use a lot of Obj-C-isms when touching said system frameworks, like the target/selector setup for most UI controls).
Same applies to many system Frameworks written before Swift happened.
I bet they aren't running X rewritten in Swift blog posts inside Apple.
The Objective-C runtime library (which objc_msgSend is a part of) allows to access the "Objective-C object model" from other languages than Objective-C via a C-API.
My guess is that Apple dont mandate Swift no new project. And the team gets to decide. It will probably be another few years when Swift 6.0 is out before a gradual transition of news apps to Swift by default.
And I am still skeptical of Swift being a system programming language. Sometimes I wonder why Apple dont make some more minor changes and improvement to ObjC.