2 ms·
> very fast This is a common sentiment, but it rarely holds up to closer scrutiny (such as measurements...). Swift is both slow to run and very slow to compil
by mpweiher 8y ago
> very fast
This is a common sentiment, but it rarely holds up to closer scrutiny (such as measurements...). Swift is both slow to run and very slow to compile. Both compile and runtime come with extremely high variance. Such unpredictability is arguably even worse than just plain slow performance.
- notafrog 8y agoUp until Swift 4, compilation took longer than with Objective-C according to my experience. Not sure how much Swift 5 has changed things.
- plainOldText 8y agoIn most of these benchmarks [1] Swift's performance comes pretty close to that of Rust. So yeah, I would call that very fast. [1] https://web.archive.org/web/20190402100249/https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/swift-rust.html https://web.archive.org/web/20190402100249/https://benchmark...
- raphlinus 8y agoTry some JSON benchmarks with Codables in Swift vs serde in Rust. Rust smokes Swift, something like 20x. Incidentally I've spent considerable effort on this problem, including writing a prototype faster JSON parser in Swift (still about 3x slower than Rust, but a huge speedup over what's there). I couldn't get anyone in the Swift community to care enough to motivate me to finish the work, which is indicative of a deeper problem: Swift just doesn't have "performance culture," the benchmark game results notwithstanding.
- mpweiher 8y agoHmm...when I look at those numbers, Swift only comes close in a very few, is significantly slower in most (50%-4x) and much slower in one (45x): fannkuch / pidgins: essentially the same binary-trees / fasta / Mandelbrot: ~ 1.5x slower spectral-norm / reverse-complement: >= 2x slower k-nucleotide / n-body: ~4x slower regex-redux: 45x slower