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.70 173,336 804 4.24 20% 33% 88% 20%
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 270,356 1324 0.61 30% 100% 35% 33%
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 158,224 1728 16.66 99% 58% 91% 71%
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,820 1420 1.74 1% 0% 1% 100%
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 82% 76% 75% 76%
C++ g++ 1.48 4,176 2313 5.25 89% 90% 88% 89%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.74 20,056 1020 42.08 100% 99% 94% 100%
C++ g++ 10.35 2,624 980 40.60 99% 99% 100% 95%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.89 52,740 1160 7.47 100% 99% 99% 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.50 13,956 1050 9.33 95% 93% 90% 97%
C++ g++ 1.99 1,880 1044 7.89 100% 99% 99% 99%
n-body
source secs mem gz cpu cpu load
Rust 13.16 5,768 1799 13.16 100% 1% 1% 0%
C++ g++ 9.31 1,052 1544 9.30 1% 1% 1% 100%
binary-trees
source secs mem gz cpu cpu load
Rust 4.33 194,824 717 15.92 100% 91% 91% 92%
C++ g++ 2.36 114,404 809 7.69 86% 71% 87% 85%
Rust

rustc 1.17.0 (56124baa9 2017-04-24)

C++ g++

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