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 11.04 1,768 1020 43.14 96% 99% 98% 99%
pidigits
source secs mem gz cpu cpu load
Swift 1.76 8,932 601 1.75 100% 2% 1% 2%
Rust 1.74 4,420 1366 1.74 100% 1% 0% 1%
binary-trees
source secs mem gz cpu cpu load
Swift 4.98 190,896 1001 14.01 61% 100% 63% 60%
Rust 3.95 171,796 721 14.30 89% 90% 88% 97%
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,728 1480 13.56 0% 0% 1% 100%
fasta
source secs mem gz cpu cpu load
Swift 2.41 32,480 2096 8.07 78% 86% 90% 81%
Rust 1.48 2,980 1906 4.59 76% 78% 78% 83%
mandelbrot
source secs mem gz cpu cpu load
Swift 3.31 39,544 1136 13.09 99% 99% 100% 99%
Rust 2.02 34,644 1332 8.00 99% 99% 100% 99%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.97 9,684 601 15.81 100% 100% 100% 100%
Rust 2.32 2,568 817 9.23 100% 100% 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.36 250,724 1376 0.65 26% 95% 35% 27%
k-nucleotide
source secs mem gz cpu cpu load
Swift 20.55 193,992 1366 76.16 91% 97% 92% 91%
Rust 4.98 137,872 1748 15.58 72% 88% 57% 98%
regex-redux
source secs mem gz cpu cpu load
Swift 74.22 898,456 715 137.84 2% 86% 100% 3%
Rust 3.00 196,176 804 4.38 85% 16% 30% 16%
Swift

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

Rust

rustc 1.21.0 (3b72af97e 2017-10-09)