The Computer Language
Benchmarks Game

Swift programs versus Rust

by benchmark task performance

fannkuch-redux
source secs mem gz cpu cpu load
Swift 10.34 9,656 1102 40.92 100% 100% 98% 98%
Rust 10.74 20,056 1020 42.08 100% 99% 94% 100%
pidigits
source secs mem gz cpu cpu load
Swift 1.75 8,128 601 1.74 1% 0% 100% 1%
Rust 1.74 7,820 1420 1.74 1% 0% 1% 100%
binary-trees
source secs mem gz cpu cpu load
Swift 4.88 192,428 997 13.77 91% 61% 69% 63%
Rust 4.33 194,824 717 15.92 100% 91% 91% 92%
fasta
source secs mem gz cpu cpu load
Swift 2.36 37,188 2096 7.26 89% 82% 73% 66%
Rust 1.48 18,524 1887 4.56 82% 76% 75% 76%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.99 13,404 601 15.82 99% 100% 99% 99%
Rust 2.50 13,956 1050 9.33 95% 93% 90% 97%
mandelbrot
source secs mem gz cpu cpu load
Swift 3.32 41,236 1136 13.17 99% 99% 99% 100%
Rust 1.89 52,740 1160 7.47 100% 99% 99% 99%
n-body
source secs mem gz cpu cpu load
Swift 23.62 7,256 1253 23.61 1% 1% 100% 0%
Rust 13.16 5,768 1799 13.16 100% 1% 1% 0%
reverse-complement
source secs mem gz cpu cpu load
Swift 0.85 273,548 1287 1.03 10% 13% 80% 22%
Rust 0.33 270,356 1324 0.61 30% 100% 35% 33%
k-nucleotide
source secs mem gz cpu cpu load
Swift 20.64 264,112 1366 76.31 93% 90% 96% 92%
Rust 5.27 158,224 1728 16.66 99% 58% 91% 71%
regex-redux
source secs mem gz cpu cpu load
Swift 101.01 695,648 671 100.95 84% 17% 1% 0%
Rust 2.70 173,336 804 4.24 20% 33% 88% 20%
Swift

Swift version 3.1-dev (LLVM 90ddc086b8, Clang 38e310f953, Swift 66d9533723)
Target: x86_64-unknown-linux-gnu

Rust

rustc 1.17.0 (56124baa9 2017-04-24)