The Computer Language
Benchmarks Game

Rust programs versus C++ g++

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Rust 2.83 179,428 804 4.22 88% 17% 17% 29%
C++ g++ 17.14 220,088 853 25.22 95% 3% 51% 1%
reverse-complement
source secs mem gz cpu cpu load
Rust 0.33 268,344 1324 0.61 34% 100% 31% 28%
C++ g++ 0.60 211,852 2275 0.98 38% 25% 82% 27%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.27 156,408 1728 17.06 77% 91% 68% 91%
C++ g++ 7.18 164,052 1252 24.28 83% 83% 93% 83%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 7,892 1420 1.74 0% 1% 100% 2%
C++ g++ 1.89 3,868 508 1.89 100% 1% 2% 1%
fasta
source secs mem gz cpu cpu load
Rust 1.48 18,524 1887 4.56 83% 76% 76% 75%
C++ g++ 1.48 4,176 2313 5.25 89% 90% 88% 89%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.82 18,084 1020 42.18 99% 100% 93% 98%
C++ g++ 10.35 2,624 980 40.60 99% 99% 100% 95%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.93 52,796 1160 7.65 100% 99% 100% 99%
C++ g++ 1.73 34,064 1002 6.80 98% 98% 98% 99%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.34 20,064 817 9.27 100% 100% 100% 100%
C++ g++ 1.99 1,880 1044 7.89 100% 99% 99% 99%
n-body
source secs mem gz cpu cpu load
Rust 13.08 5,704 1540 13.08 0% 1% 1% 100%
C++ g++ 9.31 1,052 1544 9.30 1% 1% 1% 100%
binary-trees
source secs mem gz cpu cpu load
Rust 4.43 196,468 717 16.56 92% 92% 100% 93%
C++ g++ 2.36 114,404 809 7.69 86% 71% 87% 85%
Rust

rustc 1.18.0 (03fc9d622 2017-06-06)

C++ g++

g++ (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406