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.61 995,072 1376 2.71 24% 31% 95% 24%
C++ g++ 2.93 980,716 2280 4.52 51% 23% 33% 51%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,412 1366 1.74 1% 100% 1% 1%
C++ g++ 1.89 4,272 513 1.89 1% 3% 100% 2%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.75 33,800 1332 6.86 98% 98% 100% 98%
C++ g++ 1.81 29,072 1002 7.10 98% 98% 98% 100%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.01 1,864 1020 39.03 100% 92% 99% 100%
C++ g++ 10.12 1,852 980 39.95 100% 100% 96% 100%
spectral-norm
source secs mem gz cpu cpu load
Rust 1.98 2,460 1126 7.87 100% 99% 99% 99%
C++ g++ 1.98 1,164 1044 7.87 99% 99% 99% 100%
fasta
source secs mem gz cpu cpu load
Rust 1.47 3,032 1906 4.97 83% 84% 83% 90%
C++ g++ 1.33 1,740 2711 4.29 81% 81% 81% 82%
binary-trees
source secs mem gz cpu cpu load
Rust 4.11 175,320 721 15.08 100% 90% 90% 90%
C++ g++ 3.68 119,052 809 11.93 98% 76% 77% 78%
regex-redux
source secs mem gz cpu cpu load
Rust 2.44 205,624 765 3.86 11% 91% 0% 59%
C++ g++ 1.83 203,520 1315 4.41 50% 45% 100% 49%
n-body
source secs mem gz cpu cpu load
Rust 13.27 1,796 1805 13.26 0% 1% 1% 100%
C++ g++ 9.42 1,704 1763 9.41 2% 100% 1% 0%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.41 137,908 1749 17.41 77% 89% 57% 100%
C++ g++ 3.73 156,080 1624 11.60 75% 70% 72% 96%
Rust

rustc 1.31.0 (abe02cefd 2018-12-04)
LLVM version 7.0.0

C++ g++

g++ (Ubuntu 8.2.0-7ubuntu1) 8.2.0