The Computer Language
Benchmarks Game

Swift programs versus Rust

by benchmark task performance

fannkuch-redux
source secs mem gz cpu cpu load
Swift 10.08 7,920 1102 39.91 98% 100% 98% 100%
Rust 10.57 1,804 1020 41.41 99% 100% 100% 93%
pidigits
source secs mem gz cpu cpu load
Swift 1.76 8,932 601 1.75 100% 2% 1% 2%
Rust 1.74 4,532 1366 1.74 100% 1% 0% 2%
binary-trees
source secs mem gz cpu cpu load
Swift 4.98 190,896 1001 14.01 61% 100% 63% 60%
Rust 3.88 173,136 721 14.24 90% 91% 100% 90%
n-body
source secs mem gz cpu cpu load
Swift 21.96 7,452 1253 21.95 0% 1% 100% 0%
Rust 13.57 1,756 1480 13.57 0% 1% 1% 100%
mandelbrot
source secs mem gz cpu cpu load
Swift 3.31 39,544 1136 13.09 99% 99% 100% 99%
Rust 2.02 33,572 1332 8.00 99% 100% 99% 99%
fasta
source secs mem gz cpu cpu load
Swift 2.41 32,480 2096 8.07 78% 86% 90% 81%
Rust 1.47 2,992 1906 4.58 76% 76% 83% 77%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.97 9,684 601 15.81 100% 100% 100% 100%
Rust 1.98 2,580 817 7.90 100% 99% 100% 99%
reverse-complement
source secs mem gz cpu cpu load
Swift 1.00 285,556 1287 1.18 80% 1% 36% 2%
Rust 0.37 250,708 1376 0.66 100% 28% 28% 31%
k-nucleotide
source secs mem gz cpu cpu load
Swift 20.55 193,992 1366 76.16 91% 97% 92% 91%
Rust 4.86 137,656 1748 15.42 57% 100% 75% 88%
regex-redux
source secs mem gz cpu cpu load
Swift 74.22 898,456 715 137.84 2% 86% 100% 3%
Rust 2.99 192,244 804 4.36 31% 16% 85% 16%
Swift

Swift version 4.1-dev (LLVM 3fa7aed3df, Clang 529966cf07, Swift 607f23d66d)
Target: x86_64-unknown-linux-gnu

Rust

rustc 1.22.1 (05e2e1c41 2017-11-22)