The Computer Language
Benchmarks Game

Rust programs versus C++ g++

by benchmark task performance

reverse-complement
source secs mem gz cpu cpu load
Rust 0.37 250,708 1376 0.66 100% 28% 28% 31%
C++ g++ 0.64 247,800 2280 1.03 89% 22% 31% 30%
k-nucleotide
source secs mem gz cpu cpu load
Rust 4.86 137,656 1748 15.42 57% 100% 75% 88%
C++ g++ 7.75 165,180 1276 26.02 80% 96% 82% 79%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,532 1366 1.74 100% 1% 0% 2%
C++ g++ 1.88 4,276 513 1.88 0% 100% 1% 0%
spectral-norm
source secs mem gz cpu cpu load
Rust 1.98 2,580 817 7.90 100% 99% 100% 99%
C++ g++ 2.02 1,332 1044 7.91 99% 99% 99% 99%
fasta
source secs mem gz cpu cpu load
Rust 1.47 2,992 1906 4.58 76% 76% 83% 77%
C++ g++ 1.49 4,372 2324 5.28 89% 88% 90% 90%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.57 1,804 1020 41.41 99% 100% 100% 93%
C++ g++ 10.61 2,044 980 41.90 100% 96% 100% 100%
mandelbrot
source secs mem gz cpu cpu load
Rust 2.02 33,572 1332 8.00 99% 100% 99% 99%
C++ g++ 1.64 27,636 1002 6.51 100% 99% 100% 99%
binary-trees
source secs mem gz cpu cpu load
Rust 3.88 173,136 721 14.24 90% 91% 100% 90%
C++ g++ 2.55 135,568 809 7.99 85% 96% 69% 66%
n-body
source secs mem gz cpu cpu load
Rust 13.57 1,756 1480 13.57 0% 1% 1% 100%
C++ g++ 8.23 1,856 1763 8.23 100% 1% 1% 0%
regex-redux
source secs mem gz cpu cpu load
Rust 2.99 192,244 804 4.36 31% 16% 85% 16%
C++ g++ 1.61 203,572 1315 4.18 100% 52% 57% 54%
Rust

rustc 1.22.1 (05e2e1c41 2017-11-22)

C++ g++

g++ (Ubuntu 7.2.0-8ubuntu3) 7.2.0