News for hackers. Stuff that matters.
Re:Understanding Objective-C by transpiling it to C++ by saagarjha on Saturday December 02, 2023 @12:50PM (#38500359)
Objective-C isn’t actually that bad as long as you’re aware of what constraints it puts on the compiler. People like to go “oh method calls are so slow!” but you can do a billion of them a second. The real performance win comes from selective use of optimization-friendly code on hot paths that don’t act as a black box to the compiler. Some teams move at Lightspeed to some weird janky architecture that just sucks in every aspect because they think it will help, and it usually doesn’t.
Re:Understanding Objective-C by transpiling it to C++ by meisel on Saturday December 02, 2023 @04:22PM (#38502162)
The real slowdown of Objective-C method calls is at startup where the caches haven't been filled. Pure Objective-C apps typically spend 5-15% of startup time on objc_msgSend
Re:Understanding Objective-C by transpiling it to C++ by saagarjha on Saturday December 02, 2023 @09:31PM (#38504250)
I haven’t looked into this for a while, but are method caches not included in the dyld closure?
Re:Understanding Objective-C by transpiling it to C++ by meisel on Sunday December 03, 2023 @09:39AM (#38507372)
I’m not sure