4 ms·
there's always been something i wondered about swift : how does it compare to other PL in terms of performance ? The initial promise was to have it be comparab
by bsaul 7y ago
there's always been something i wondered about swift : how does it compare to other PL in terms of performance ?
The initial promise was to have it be comparable to other compiled languages ( java , c++, whatever), but i've yet to find a real benchmark.
Or rather, the ones i've seen made it look more on the range of interpreted/dynamic languages ( ruby / python or node), at least for server side projects. Which came as a surprise to me.
Has any real work been work on that issue somewhere ?
- pjmlp 7y agoRather slow currently, thanks ARC. https://github.com/ixy-languages/ixy-languages https://github.com/ixy-languages/ixy-languages
- skohan 7y agoThis is not a good representative benchmark for Swift. It uses lots of reference counted objects within tight loops, which is a worst-case for Swift. It's also not idiomatic Swift - classes are used in many places where they should not be. Also, it's a benchmark which needs special hardware to be run, so it's not easy to try to reproduce or improve on this result.
- pjmlp 7y agoThe same conditions apply to all languages.
- skohan 7y agoNo they don't. GC language, for example, are more sensitive to memory pressure to reference counting overhead.
- pjmlp 7y agoFirst, Swift is also a GC language. Secondly, with exception of Java, the remaining ones on that benchmark support value types and native heap allocations.
- skohan 7y agoWe can get into semantics all day, but the point still stands that different languages are going to perform differently on any given benchmarks due to the performance constraints of that language. Also I would love to see an implementation of the swift benchmark which doesn't lean on reference types, which is not idiomatic swift and is likely the reason the ARC penalty is so high here.