The Computer Language
Benchmarks Game

Swift programs versus Rust

by benchmark task performance

mandelbrot
source secs mem gz cpu cpu load
Swift 3.32 41,532 1136 13.18 100% 99% 99% 100%
Rust 4.93 71,144 868 19.48 99% 98% 100% 100%
fannkuch-redux
source secs mem gz cpu cpu load
Swift 10.20 9,868 1102 40.42 100% 99% 100% 98%
Rust 10.99 20,012 1020 43.08 94% 100% 99% 100%
pidigits
source secs mem gz cpu cpu load
Swift 1.75 8,636 601 1.75 1% 1% 2% 100%
Rust 1.74 7,820 1306 1.74 3% 1% 100% 2%
binary-trees
source secs mem gz cpu cpu load
Swift 4.90 192,756 997 13.74 99% 60% 62% 62%
Rust 4.66 184,704 717 17.32 92% 91% 91% 100%
fasta
source secs mem gz cpu cpu load
Swift 2.42 34,544 2096 7.70 90% 85% 68% 79%
Rust 1.49 18,592 1887 4.64 77% 84% 76% 76%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.97 11,760 601 15.82 100% 100% 100% 100%
Rust 2.44 20,048 817 9.60 98% 99% 98% 99%
n-body
source secs mem gz cpu cpu load
Swift 21.96 7,436 1253 21.95 0% 1% 1% 100%
Rust 12.82 5,672 1540 12.81 0% 0% 100% 1%
reverse-complement
source secs mem gz cpu cpu load
Swift 0.85 212,084 1287 1.03 41% 80% 2% 5%
Rust 0.33 268,384 1324 0.61 100% 36% 31% 31%
k-nucleotide
source secs mem gz cpu cpu load
Swift 20.73 244,084 1366 76.60 92% 90% 97% 92%
Rust 5.40 156,208 1627 16.18 86% 99% 66% 51%
regex-redux
source secs mem gz cpu cpu load
Swift 83.47 872,904 715 151.55 89% 93% 2% 1%
Rust 2.73 175,372 701 4.24 19% 19% 100% 20%
Swift

Swift version 4.0-dev (LLVM a15decabe3, Clang d08a136083, Swift 2edf2b26d0)
Target: x86_64-unknown-linux-gnu

Rust

rustc 1.19.0 (0ade33941 2017-07-17)