

Swift performance: sorting arrays - ritchiea
http://stackoverflow.com/questions/24101718/swift-performance-sorting-arrays?

======
adamnemecek
People don't seem to understand that it's still in a beta stage. A semi-public
beta but a beta nonetheless.

~~~
ritchiea
I don't think that's it. At WWDC Apple boasted that Swift is faster than
Objective-C. I'm sure the compiler will be improved before its out of beta but
people are going to investigate these sort of things and doubly so if you brag
that your language is fast.

~~~
adamnemecek
[https://www.mikeash.com/pyblog/friday-
qa-2014-07-04-secrets-...](https://www.mikeash.com/pyblog/friday-
qa-2014-07-04-secrets-of-swifts-speed.html)

~~~
dmurdoch
"While the language should allow for great performance, the current compiler
is still a bit rough, and I've had a hard time getting Swift to come out ahead
in any performance tests. Most of the slowness looks to come down to a lot of
redundant retain/release activity being emitted by the compiler. I expect this
to be fixed before too long, but in the meantime, it means that this article
is going to be more about how Swift could potentially be faster than
Objective-C than about how it's actually faster right now."

Well that is very much in-line with what the SO page is saying, lots of retain
release operations.

" I did not try to understand all of it, but the most suspicious parts are 13
invocations of "callq _swift_retain" and another 13 invocations of "callq
_swift_release". That is, 26 subroutine calls in the inner loop!"

~~~
adamnemecek
The main difference is that Swift unlike obj-c can be made fast.

