swift performance and efficiency

Hello, I am looking into learn swift for OS X iOS and maybe general Linux. My question is: How swift performance and efficiency compared to c++ or rust? Thank you

Replies

You will find here a series of benchmarks (I have not seen how they have been audited).


h ttps://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=swift&lang2=rust


Let you interpret. But remember that performance is not only the language but largely (mostly) the quality of one's programming.


What tytpe of application do you want to develop ? Is performance absolutely critical ? Don't forget ease of programming, robustness of code and capability to maintain ?

macOS & iOS? Swift and Obj-c.


Especially since iOS as an example doesn't run the others, so there is no comparison to be specifically made.

One of the application I would like to make is kind of centralize ui that manage many entities so it heavily depends in concurrency and it bound to http requests (network will be the bottleneck). In this case, no I can't say high performance is mandatory. This is just for my own personal knowledge, but maybe this app or another one will require higher performance. In the end no one like slow app or slow response. 1. How well concurrency is addressed and scaled in swift or objective-c? 2. What are use cases to choose objective-c, react, visual-c++ angular vs swift? Thank you

look at those benchmarks at how C crushes swift. of course if you can hack fortran, like i do, you'd be able to write code that natively stomps on those C benchmarks especially for complex floating point operations. with a newer version of gcc-8, the numbers would probably improve.


when the ABI going to be released for swift???


you can fairly easily hook into a C or C++ lib and use swift as a front-end/gui. for audio plugins which need real-time, you have to write a C lib, swift will choke/delay with GCD trying to manage the access time/memory slices. where C just does it.

>when the ABI going to be released for swift???


Might want to ask via swift.org, but they can't begin to level it for release until the Swift ABI manifesto is complete, so...might be a while.


h ttps://github.com/apple/swift/blob/master/docs/ABIStabilityManifesto.md