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.59 1,776 1020 41.71 100% 99% 100% 95%
pidigits
source secs mem gz cpu cpu load
Swift 1.76 8,932 601 1.75 100% 2% 1% 2%
Rust 1.74 4,612 1366 1.74 2% 0% 0% 99%
binary-trees
source secs mem gz cpu cpu load
Swift 4.98 190,896 1001 14.01 61% 100% 63% 60%
Rust 4.02 167,776 721 14.63 89% 99% 91% 89%
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,768 1480 13.57 100% 0% 0% 1%
fasta
source secs mem gz cpu cpu load
Swift 2.41 32,480 2096 8.07 78% 86% 90% 81%
Rust 1.47 2,988 1906 4.55 83% 76% 76% 76%
mandelbrot
source secs mem gz cpu cpu load
Swift 3.31 39,544 1136 13.09 99% 99% 100% 99%
Rust 1.97 13,340 1007 7.86 99% 99% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.97 9,684 601 15.81 100% 100% 100% 100%
Rust 2.27 2,624 817 9.00 100% 99% 100% 100%
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,784 1376 0.66 29% 29% 100% 28%
k-nucleotide
source secs mem gz cpu cpu load
Swift 20.55 193,992 1366 76.16 91% 97% 92% 91%
Rust 5.06 137,864 1748 15.66 54% 97% 71% 89%
regex-redux
source secs mem gz cpu cpu load
Swift 74.22 898,456 715 137.84 2% 86% 100% 3%
Rust 3.05 188,644 804 4.48 31% 17% 85% 16%
Swift

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

Rust

rustc 1.23.0 (766bd11c8 2018-01-01)