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.81 211,044 804 4.30 19% 100% 18% 19%
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 254,596 1324 0.62 31% 36% 100% 34%
C++ g++ 0.60 211,852 2275 0.98 38% 25% 82% 27%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.20 155,200 1728 16.14 91% 54% 100% 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,892 1420 1.74 100% 1% 2% 1%
C++ g++ 1.89 3,868 508 1.89 100% 1% 2% 1%
fasta
source secs mem gz cpu cpu load
Rust 1.48 20,252 1887 4.60 83% 76% 76% 77%
C++ g++ 1.48 4,176 2313 5.25 89% 90% 88% 89%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 11.21 20,064 1020 43.78 100% 100% 95% 97%
C++ g++ 10.35 2,624 980 40.60 99% 99% 100% 95%
mandelbrot
source secs mem gz cpu cpu load
Rust 2.03 44,720 1332 8.00 99% 100% 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.33 18,048 817 9.26 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.57 5,824 1474 13.56 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 3.98 213,448 717 14.66 92% 90% 90% 100%
C++ g++ 2.36 114,404 809 7.69 86% 71% 87% 85%
Rust

rustc 1.21.0 (3b72af97e 2017-10-09)

C++ g++

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