2 ms·
Swift's performance is a mixed bag, and can be closer to JavaScript than C++. It heavily depends on how you manage your objects and how many memory allocations
by pornel 4y ago
Swift's performance is a mixed bag, and can be closer to JavaScript than C++. It heavily depends on how you manage your objects and how many memory allocations and copies that causes. Swift prioritizes nice syntax over implicit overheads, so it's something to look out for.
If you really really need something high-performance, then Rust is the main contender. Don't be fooled by superficially similar angle brackets syntax. It's not similar to C++, it's is not even a C-family language (closer to ML). Things like having multiple string types may seem like the same mess, but it's not a legacy baggage like in C++, but an explicit meaningful choice exposing ownership and encoding semantics.
If you merely need pretty good performance, go for golang. It's very successful for services.
I don't see room for Swift in server-side languages. It won't be able to shake being Apple's technology first, and having Linux support as a second class. It's not low-level enough to beat Rust on performance. It can't compete with popularity and ease of use of JS/TS and golang.