The Computer Language
Benchmarks Game

Rust versus C++ g++ fastest programs

by faster benchmark performance

reverse-complement
source secs mem gz cpu cpu load
Rust 1.62 995,104 1376 2.75 24% 25% 100% 25%
C++ g++ 2.95 980,472 2280 4.56 50% 41% 16% 50%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 9.44 1,740 1020 36.95 93% 100% 99% 100%
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,620 1366 1.74 100% 2% 0% 1%
C++ g++ 1.89 4,284 513 1.88 5% 0% 1% 100%
fasta
source secs mem gz cpu cpu load
Rust 1.47 3,024 1906 4.54 76% 77% 76% 83%
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,164 1332 6.87 98% 98% 98% 100%
C++ g++ 1.51 25,588 1791 5.99 99% 99% 99% 99%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.31 2,516 817 9.18 100% 100% 100% 100%
C++ g++ 1.98 1,340 1044 7.87 99% 100% 99% 99%
regex-redux
source secs mem gz cpu cpu load
Rust 2.54 202,448 765 3.97 64% 20% 57% 18%
C++ g++ 1.66 203,568 1315 4.23 48% 53% 57% 99%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.76 135,728 1900 16.77 84% 94% 49% 65%
C++ g++ 3.66 155,956 1624 11.16 70% 98% 70% 68%
n-body
source secs mem gz cpu cpu load
Rust 13.13 1,740 1805 13.12 1% 100% 0% 1%
C++ g++ 8.24 1,924 1763 8.23 1% 0% 100% 1%
binary-trees
source secs mem gz cpu cpu load
Rust 4.31 164,868 721 15.85 90% 90% 100% 90%
C++ g++ 2.62 130,212 809 7.92 76% 67% 63% 99%
Rust

rustc 1.28.0 (9634041f0 2018-07-30)

C++ g++

g++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0