4 ms·
Swift performance: sorting arrays
- adamnemecek 12y agoPeople don't seem to understand that it's still in a beta stage. A semi-public beta but a beta nonetheless.
- _random_ 12y agoWhy call Swift something that isn't swift? Also it was in development for years.
- adamnemecek 12y agohttps://www.mikeash.com/pyblog/friday-qa-2014-07-04-secrets-of-swifts-speed.html https://www.mikeash.com/pyblog/friday-qa-2014-07-04-secrets-...
- ritchiea 12y agoI 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 12y agohttps://www.mikeash.com/pyblog/friday-qa-2014-07-04-secrets-of-swifts-speed.html https://www.mikeash.com/pyblog/friday-qa-2014-07-04-secrets-...
- dmurdoch 12y ago"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 12y agoThe main difference is that Swift unlike obj-c can be made fast.