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,100 1376 2.72 25% 81% 39% 28%
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,752 1020 37.68 100% 96% 99% 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,488 1366 1.74 1% 100% 1% 0%
C++ g++ 1.89 4,284 513 1.88 5% 0% 1% 100%
spectral-norm
source secs mem gz cpu cpu load
Rust 1.98 2,472 1126 7.86 100% 100% 99% 100%
C++ g++ 1.98 1,340 1044 7.87 99% 100% 99% 99%
fasta
source secs mem gz cpu cpu load
Rust 1.47 2,988 1906 4.97 88% 83% 90% 84%
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,176 1332 6.86 98% 98% 100% 98%
C++ g++ 1.51 25,588 1791 5.99 99% 99% 99% 99%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.34 138,504 1749 17.16 87% 100% 78% 58%
C++ g++ 3.66 155,956 1624 11.16 70% 98% 70% 68%
binary-trees
source secs mem gz cpu cpu load
Rust 3.98 165,920 721 14.61 90% 100% 90% 89%
C++ g++ 2.63 130,600 809 7.93 98% 68% 62% 76%
regex-redux
source secs mem gz cpu cpu load
Rust 2.54 204,160 765 3.95 55% 30% 56% 18%
C++ g++ 1.66 203,568 1315 4.23 48% 53% 57% 99%
n-body
source secs mem gz cpu cpu load
Rust 13.31 1,768 1805 13.31 0% 0% 1% 100%
C++ g++ 8.24 1,924 1763 8.23 1% 0% 100% 1%
Rust

rustc 1.29.0 (aa3ca1994 2018-09-11)
LLVM version 5.0.1

C++ g++

g++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0