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.80 20,028 1020 43.07 100% 100% 100% 100%
pidigits
source secs mem gz cpu cpu load
Swift 1.75 8,128 601 1.74 1% 0% 100% 1%
Rust 1.75 6,280 1306 1.74 2% 1% 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.27 184,600 714 15.84 98% 92% 92% 92%
fasta
source secs mem gz cpu cpu load
Swift 2.36 37,188 2096 7.26 89% 82% 73% 66%
Rust 1.49 20,324 1887 4.55 75% 76% 75% 82%
mandelbrot
source secs mem gz cpu cpu load
Swift 3.32 41,236 1136 13.17 99% 99% 99% 100%
Rust 1.90 38,724 1160 7.48 98% 98% 99% 98%
n-body
source secs mem gz cpu cpu load
Swift 23.62 7,256 1253 23.61 1% 1% 100% 0%
Rust 13.08 3,676 1799 13.08 1% 1% 100% 1%
reverse-complement
source secs mem gz cpu cpu load
Swift 0.85 273,548 1287 1.03 10% 13% 80% 22%
Rust 0.45 254,232 1324 0.76 25% 26% 28% 98%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.99 13,404 601 15.82 99% 100% 99% 99%
Rust 2.01 20,080 817 7.96 100% 100% 100% 100%
k-nucleotide
source secs mem gz cpu cpu load
Swift 20.64 264,112 1366 76.31 93% 90% 96% 92%
Rust 5.30 140,364 1728 16.34 100% 86% 55% 70%
regex-redux
source secs mem gz cpu cpu load
Swift 101.01 695,648 671 100.95 84% 17% 1% 0%
Rust 3.28 222,916 804 6.46 33% 100% 32% 35%
Swift

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

Rust

rustc 1.16.0 (30cf806ef 2017-03-10)