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 994,780 1376 2.75 25% 25% 25% 99%
C++ g++ 2.93 980,716 2280 4.52 51% 23% 33% 51%
n-body
source secs mem gz cpu cpu load
Rust 5.82 916 1753 5.82 2% 3% 100% 1%
C++ g++ 9.37 1,712 1808 9.37 0% 2% 1% 100%
pidigits
source secs mem gz cpu cpu load
Rust 1.75 3,036 1366 1.75 100% 1% 1% 0%
C++ g++ 1.89 4,380 513 1.88 2% 99% 4% 2%
binary-trees
source secs mem gz cpu cpu load
Rust 3.60 166,588 754 13.05 89% 89% 89% 99%
C++ g++ 3.68 119,052 809 11.93 98% 76% 77% 78%
spectral-norm
source secs mem gz cpu cpu load
Rust 1.97 2,204 1126 7.86 99% 99% 100% 100%
C++ g++ 1.98 1,164 1044 7.87 99% 99% 99% 100%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.13 916 1020 39.51 100% 100% 92% 100%
C++ g++ 10.12 1,852 980 39.95 100% 100% 96% 100%
fasta
source secs mem gz cpu cpu load
Rust 1.46 2,008 1906 4.56 77% 78% 78% 83%
C++ g++ 1.33 1,740 2711 4.29 81% 81% 81% 82%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.74 32,472 1332 6.86 100% 98% 98% 98%
C++ g++ 1.51 25,640 1791 5.99 100% 100% 99% 99%
regex-redux
source secs mem gz cpu cpu load
Rust 2.44 199,876 765 3.87 27% 84% 49% 0%
C++ g++ 1.83 203,520 1315 4.41 50% 45% 100% 49%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.45 135,028 1648 17.24 87% 100% 57% 75%
C++ g++ 3.73 156,080 1624 11.60 75% 70% 72% 96%
Rust

rustc 1.32.0 (9fda7c223 2019-01-16)
LLVM version 8.0

C++ g++

g++ (Ubuntu 8.2.0-7ubuntu1) 8.2.0