Hacker News new | ask | show | jobs
by robenkleene 3736 days ago
Thanks for the detailed response, to summarize it sounds like your position is that:

1. Objective-C's compile time memory management is actually slower than JavaScript's garbage collection.

2. The performance consequences of Objective-C message sending are greater than JavaScript's JIT compilation. And furthermore, that JIT compilation is actually an advantage due to the other optimization techniques it enables.

I'd like to see a more direct comparison with benchmarks, but I can see where you're coming from.

1 comments

Right. Note that this advantage pretty much goes away with Swift. Swift is very smartly designed to fix the exact problems that Apple was hitting with Objective-C performance.

I realized another issue, too: I don't think it's possible to perform scalar replacement of aggregates on Objective-C objects at all, whereas JavaScript engines are now starting to be able to escape analyze and SROA JS values. SROA is another critical optimization because it converts memory into SSA values, where instcombine and other optimizations can work on them. Again, Swift fixes this with SIL-level SROA.