Re:Brilliant Hardware in the Valley of the Software Slump
by zozbot234 on Friday June 12, 2020 @05:31PM
(#23504124)
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.
[ Parent
| on HN ]
Re:Brilliant Hardware in the Valley of the Software Slump
by saagarjha on Sunday June 14, 2020 @01:21AM
(#23515319)
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.
Re:Brilliant Hardware in the Valley of the Software Slump
by robomartin on Friday June 12, 2020 @05:37PM
(#23504168)
Agreed. See my edit.