The Computer Language
Benchmarks Game

Swift programs versus Rust

by benchmark task performance

pidigits
source secs mem gz cpu cpu load
Swift 1.75 7,396 601 1.74 1% 1% 100% 0%
Rust 1.75 6,280 1306 1.74 2% 1% 1% 100%
fannkuch-redux
source secs mem gz cpu cpu load
Swift 11.44 6,900 1102 45.27 100% 100% 98% 98%
Rust 10.80 20,028 1020 43.07 100% 100% 100% 100%
binary-trees
source secs mem gz cpu cpu load
Swift 5.55 247,508 1062 16.74 65% 74% 70% 95%
Rust 4.94 385,756 764 19.07 96% 96% 96% 100%
fasta
source secs mem gz cpu cpu load
Swift 2.40 32,536 2096 7.26 78% 81% 72% 73%
Rust 1.49 20,324 1887 4.55 75% 76% 75% 82%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.97 10,696 601 15.79 100% 100% 100% 100%
Rust 2.36 14,036 1050 9.04 99% 99% 99% 99%
mandelbrot
source secs mem gz cpu cpu load
Swift 3.22 40,340 1136 12.76 99% 99% 100% 99%
Rust 1.90 38,724 1160 7.48 98% 98% 99% 98%
n-body
source secs mem gz cpu cpu load
Swift 23.59 4,336 1253 23.58 0% 100% 1% 0%
Rust 13.08 3,676 1799 13.08 1% 1% 100% 1%
reverse-complement
source secs mem gz cpu cpu load
Swift 0.94 285,740 1287 1.12 54% 0% 47% 21%
Rust 0.45 254,232 1324 0.76 25% 26% 28% 98%
k-nucleotide
source secs mem gz cpu cpu load
Swift 20.48 263,288 1366 75.71 91% 99% 91% 91%
Rust 5.30 140,364 1728 16.34 100% 86% 55% 70%
regex-redux
source secs mem gz cpu cpu load
Swift 97.48 694,832 671 97.43 1% 100% 0% 1%
Rust 3.28 222,916 804 6.46 33% 100% 32% 35%
Swift Swift version 3.1-dev (LLVM a7c680da51, Clang 9772bf511a, Swift 00b540bfbb)
Target: x86_64-unknown-linux-gnu
swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-13-a-ubuntu16.04
Rust

rustc 1.16.0 (30cf806ef 2017-03-10)