3 ms·
> Unless your objc code is written using nothing but id and reflection That's how all Objective-C code is written–every method call goes through objc_msgSend.
by saagarjha 8y ago
> Unless your objc code is written using nothing but id and reflection
That's how all Objective-C code is written–every method call goes through objc_msgSend.
- sitharus 8y agoTo be fair to objc_msgSend it's orders of magnitude faster than most reflection APIs. https://www.mikeash.com/pyblog/performance-comparisons-of-common-operations.html https://www.mikeash.com/pyblog/performance-comparisons-of-co... has some benchmarks, it's a bit old but I don't think objc_msgSend would get slower.
- saagarjha 8y agoYup, I'm not saying objc_msgSend is slow: it's just that it's not faster than a direct call, and I believe about on-par with a virtual function call.