The Computer Language
Benchmarks Game

Rust programs versus C++ g++

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Rust 3.28 222,916 804 6.46 33% 100% 32% 35%
C++ g++ 17.14 220,088 853 25.22 95% 3% 51% 1%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.30 140,364 1728 16.34 100% 86% 55% 70%
C++ g++ 7.18 164,052 1252 24.28 83% 83% 93% 83%
reverse-complement
source secs mem gz cpu cpu load
Rust 0.45 254,232 1324 0.76 25% 26% 28% 98%
C++ g++ 0.60 211,852 2275 0.98 38% 25% 82% 27%
pidigits
source secs mem gz cpu cpu load
Rust 1.75 6,280 1306 1.74 2% 1% 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.49 20,324 1887 4.55 75% 76% 75% 82%
C++ g++ 1.48 4,176 2313 5.25 89% 90% 88% 89%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.01 20,080 817 7.96 100% 100% 100% 100%
C++ g++ 1.99 1,880 1044 7.89 100% 99% 99% 99%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.80 20,028 1020 43.07 100% 100% 100% 100%
C++ g++ 10.35 2,624 980 40.60 99% 99% 100% 95%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.90 38,724 1160 7.48 98% 98% 99% 98%
C++ g++ 1.73 34,064 1002 6.80 98% 98% 98% 99%
n-body
source secs mem gz cpu cpu load
Rust 13.08 3,676 1799 13.08 1% 1% 100% 1%
C++ g++ 9.31 1,052 1544 9.30 1% 1% 1% 100%
binary-trees
source secs mem gz cpu cpu load
Rust 4.27 184,600 714 15.84 98% 92% 92% 92%
C++ g++ 2.36 114,404 809 7.69 86% 71% 87% 85%
Rust

rustc 1.16.0 (30cf806ef 2017-03-10)

C++ g++

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