The Computer Language
Benchmarks Game

Swift programs versus Rust

by benchmark task performance

fannkuch-redux
source secs mem gz cpu cpu load
Swift 10.20 9,784 1102 40.28 100% 99% 98% 98%
Rust 11.21 20,064 1020 43.78 100% 100% 95% 97%
pidigits
source secs mem gz cpu cpu load
Swift 1.75 8,532 601 1.75 100% 1% 1% 0%
Rust 1.74 7,892 1420 1.74 100% 1% 2% 1%
binary-trees
source secs mem gz cpu cpu load
Swift 4.96 192,596 997 13.89 60% 63% 61% 99%
Rust 3.98 213,448 717 14.66 92% 90% 90% 100%
fasta
source secs mem gz cpu cpu load
Swift 2.32 34,356 2096 7.62 76% 79% 83% 93%
Rust 1.48 20,252 1887 4.60 83% 76% 76% 77%
n-body
source secs mem gz cpu cpu load
Swift 21.96 7,396 1253 21.95 1% 100% 1% 0%
Rust 13.57 5,824 1474 13.56 1% 1% 100% 1%
mandelbrot
source secs mem gz cpu cpu load
Swift 3.32 41,748 1136 13.19 100% 99% 99% 99%
Rust 2.03 44,720 1332 8.00 99% 100% 99% 99%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.98 11,292 601 15.82 100% 100% 100% 100%
Rust 2.33 18,048 817 9.26 100% 100% 100% 100%
reverse-complement
source secs mem gz cpu cpu load
Swift 0.86 210,216 1287 1.03 79% 2% 1% 42%
Rust 0.33 254,596 1324 0.62 31% 36% 100% 34%
k-nucleotide
source secs mem gz cpu cpu load
Swift 20.73 246,548 1366 76.47 94% 94% 90% 92%
Rust 5.20 155,200 1728 16.14 91% 54% 100% 71%
regex-redux
source secs mem gz cpu cpu load
Swift 75.47 882,900 715 141.92 90% 2% 1% 100%
Rust 2.81 211,044 804 4.30 19% 100% 18% 19%
Swift

Swift version 4.0 (swift-4.0-RELEASE)
Target: x86_64-unknown-linux-gnu

Rust

rustc 1.21.0 (3b72af97e 2017-10-09)