Re:The Objective-C Runtime and Swift Dynamism
by mpweiher on Thursday December 14, 2017 @08:42AM
(#15922148)
There are many cases like that. How was that with protocol generics and collections? When can it remove ARC calls?
> It's C vs C++ all over again...
From a performance POV, it seems to be a lot worse than C++. Much less baseline performance, less predictability, and almost no way to get to peak performance.
https://medium.com/folded-plane/swift-array-appending-and-av...
So Swift is faster than ObjC by a constant factor, until you run into this subtle issue (which didn't really exist in ObjC), and then it's suddenly slower by a full O(n). Whether that's a good trade-off depends on how good of a language lawyer you are. It's C vs C++ all over again...