The Computer Language
Benchmarks Game

Rust programs versus C++ g++

by benchmark task performance

reverse-complement
source secs mem gz cpu cpu load
Rust 0.42 250,836 1376 0.70 24% 32% 95% 24%
C++ g++ 0.64 247,800 2280 1.03 89% 22% 31% 30%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.61 138,052 1647 16.38 81% 100% 49% 63%
C++ g++ 7.75 165,180 1276 26.02 80% 96% 82% 79%
pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,608 1366 1.74 100% 1% 1% 3%
C++ g++ 1.88 4,276 513 1.88 0% 100% 1% 0%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.96 1,748 1020 42.90 99% 100% 99% 93%
C++ g++ 10.61 2,044 980 41.90 100% 96% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.35 2,632 817 9.37 100% 100% 100% 100%
C++ g++ 2.02 1,332 1044 7.91 99% 99% 99% 99%
fasta
source secs mem gz cpu cpu load
Rust 2.05 3,276 1906 5.06 59% 71% 59% 59%
C++ g++ 1.35 1,952 2711 4.18 79% 78% 78% 79%
mandelbrot
source secs mem gz cpu cpu load
Rust 2.78 34,856 1332 10.96 99% 100% 99% 99%
C++ g++ 1.64 27,636 1002 6.51 100% 99% 100% 99%
binary-trees
source secs mem gz cpu cpu load
Rust 4.37 178,280 721 15.88 89% 90% 99% 88%
C++ g++ 2.55 135,568 809 7.99 85% 96% 69% 66%
n-body
source secs mem gz cpu cpu load
Rust 14.32 1,748 1805 14.32 100% 1% 1% 0%
C++ g++ 8.23 1,856 1763 8.23 100% 1% 1% 0%
regex-redux
source secs mem gz cpu cpu load
Rust   Make Error
C++ g++ 0.02 ? 1315 0.06 100% 50% 67% 100%
Rust

rustc 1.24.0 (4d90ac38c 2018-02-12)

C++ g++

g++ (Ubuntu 7.2.0-8ubuntu3) 7.2.0