The Computer Language
Benchmarks Game

Rust programs versus C++ g++

by benchmark task performance

reverse-complement
source secs mem gz cpu cpu load
Rust 1.62 995,084 1376 2.75 100% 24% 26% 24%
C++ g++ 2.95 980,472 2280 4.56 50% 41% 16% 50%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 9.60 1,816 1020 37.59 100% 94% 100% 99%
C++ g++ 10.62 2,040 980 41.91 100% 95% 100% 100%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,672 1366 1.74 1% 1% 100% 0%
C++ g++ 1.89 4,284 513 1.88 5% 0% 1% 100%
fasta
source secs mem gz cpu cpu load
Rust 1.47 2,980 1961 4.47 78% 75% 75% 82%
C++ g++ 1.33 1,956 2711 4.16 79% 79% 79% 79%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.75 34,132 1332 6.86 98% 100% 98% 98%
C++ g++ 1.51 25,588 1791 5.99 99% 99% 99% 99%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.30 2,520 817 9.18 100% 100% 100% 100%
C++ g++ 1.98 1,340 1044 7.87 99% 100% 99% 99%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.28 137,948 1749 16.08 69% 100% 52% 85%
C++ g++ 3.66 155,956 1624 11.16 70% 98% 70% 68%
binary-trees
source secs mem gz cpu cpu load
Rust 4.13 167,624 721 15.17 90% 100% 89% 90%
C++ g++ 2.62 130,212 809 7.92 76% 67% 63% 99%
n-body
source secs mem gz cpu cpu load
Rust 13.26 1,784 1480 13.25 3% 1% 100% 1%
C++ g++ 8.24 1,924 1763 8.23 1% 0% 100% 1%
regex-redux
source secs mem gz cpu cpu load
Rust 3.01 180,660 804 4.41 16% 16% 16% 100%
C++ g++ 1.66 203,568 1315 4.23 48% 53% 57% 99%
Rust

rustc 1.26.0 (a77568041 2018-05-07)

C++ g++

g++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0