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.73 175,372 701 4.24 19% 19% 100% 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 268,384 1324 0.61 100% 36% 31% 31%
C++ g++ 0.60 211,852 2275 0.98 38% 25% 82% 27%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.40 156,208 1627 16.18 86% 99% 66% 51%
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 1306 1.74 3% 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.49 18,592 1887 4.64 77% 84% 76% 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.99 20,012 1020 43.08 94% 100% 99% 100%
C++ g++ 10.35 2,624 980 40.60 99% 99% 100% 95%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.44 20,048 817 9.60 98% 99% 98% 99%
C++ g++ 1.99 1,880 1044 7.89 100% 99% 99% 99%
n-body
source secs mem gz cpu cpu load
Rust 12.82 5,672 1540 12.81 0% 0% 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.66 184,704 717 17.32 92% 91% 91% 100%
C++ g++ 2.36 114,404 809 7.69 86% 71% 87% 85%
mandelbrot
source secs mem gz cpu cpu load
Rust 4.93 71,144 868 19.48 99% 98% 100% 100%
C++ g++ 1.73 34,064 1002 6.80 98% 98% 98% 99%
Rust

rustc 1.19.0 (0ade33941 2017-07-17)

C++ g++

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