Hacker News new | past | comments | ask | show | jobs | submit login

Objective C will always be an absolute dog for high-performance work because of how everything has to go through dynamic dispatch and indirection steps. It's why even Apple is trying to replace it with Swift - that name is not coincidental! And the Rust language by Mozilla is even better performance than Swift while supporting a great set of principled, higher-level language features if you want them.



The average overhead of a message send using the runtime Apple ships these days is insanely low; it’s on the order of approximately two nanoseconds a call. With some minor insight you can bring that down to well under a nanosecond, literally single-digit clock cycles, just by testing if indirection is necessary. (For reference, this is about on par with, or on days I’m feeling a bit confident even better than, a C++ virtual method call.) There is no way that Objective-C is hundreds of times slower than C++ unless there is something else going on.


Agreed. See my edit.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: