The Computer Language
Benchmarks Game

Swift programs versus Rust

by benchmark task performance

fannkuch-redux
source secs mem gz cpu cpu load
Swift 10.13 8,124 1102 40.08 100% 98% 100% 98%
Rust 10.96 1,748 1020 42.90 99% 100% 99% 93%
pidigits
source secs mem gz cpu cpu load
Swift 1.75 8,840 601 1.75 99% 2% 1% 1%
Rust 1.74 4,608 1366 1.74 100% 1% 1% 3%
binary-trees
source secs mem gz cpu cpu load
Swift 4.94 192,436 1001 13.92 61% 59% 63% 100%
Rust 4.37 178,280 721 15.88 89% 90% 99% 88%
fasta
source secs mem gz cpu cpu load
Swift 2.36 31,504 2096 7.83 84% 86% 95% 68%
Rust 2.05 3,276 1906 5.06 59% 71% 59% 59%
mandelbrot
source secs mem gz cpu cpu load
Swift 3.30 39,568 1136 13.07 99% 100% 99% 99%
Rust 2.78 34,856 1332 10.96 99% 100% 99% 99%
n-body
source secs mem gz cpu cpu load
Swift 21.91 15,832 1357 21.90 63% 0% 0% 38%
Rust 14.32 1,748 1805 14.32 100% 1% 1% 0%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.95 9,764 601 15.73 100% 100% 99% 100%
Rust 2.35 2,632 817 9.37 100% 100% 100% 100%
reverse-complement
source secs mem gz cpu cpu load
Swift 1.09 224,832 1287 1.27 2% 2% 33% 82%
Rust 0.42 250,836 1376 0.70 24% 32% 95% 24%
k-nucleotide
source secs mem gz cpu cpu load
Swift 21.75 259,972 1366 80.88 91% 91% 96% 95%
Rust 5.61 138,052 1647 16.38 81% 100% 49% 63%
regex-redux
source secs mem gz cpu cpu load
Swift 0.75 25,540 715 1.36 81% 99% 4% 0%
Rust   Make Error
Swift

Swift version 4.1-dev (LLVM 7598a1fc69, Clang 8be462d5b8, Swift 6618eb5c9b)
Target: x86_64-unknown-linux-gnu

Rust

rustc 1.24.0 (4d90ac38c 2018-02-12)