The Computer Language
Benchmarks Game

Rust programs versus C++ g++

by benchmark task performance

pidigits
source secs mem gz cpu cpu load
Rust 1.74 4,592 1366 1.74 1% 1% 3% 100%
C++ g++ 1.88 4,276 513 1.88 0% 100% 1% 0%
reverse-complement
source secs mem gz cpu cpu load
Rust 3.29 1,044,220 1871 4.33 33% 20% 77% 26%
C++ g++ 3.08 980,604 2280 4.66 62% 25% 12% 54%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 12.07 1,832 1191 47.32 99% 100% 95% 99%
C++ g++ 10.61 2,044 980 41.90 100% 96% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.51 2,752 1053 9.20 91% 93% 95% 90%
C++ g++ 2.02 1,332 1044 7.91 99% 99% 99% 99%
mandelbrot
source secs mem gz cpu cpu load
Rust 1.89 13,712 1007 7.51 100% 99% 100% 99%
C++ g++ 1.51 25,704 1791 5.99 99% 100% 100% 100%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.53 140,784 1671 16.44 83% 51% 67% 99%
C++ g++ 3.78 156,108 1624 11.44 91% 70% 75% 70%
n-body
source secs mem gz cpu cpu load
Rust 13.24 1,704 1480 13.23 1% 1% 1% 100%
C++ g++ 8.23 1,856 1763 8.23 100% 1% 1% 0%
regex-redux
source secs mem gz cpu cpu load
Rust 3.02 189,036 804 4.40 87% 15% 17% 29%
C++ g++ 1.61 203,572 1315 4.18 100% 52% 57% 54%
binary-trees
source secs mem gz cpu cpu load
Rust 6.36 119,720 751 21.40 94% 77% 78% 90%
C++ g++ 2.55 135,568 809 7.99 85% 96% 69% 66%
fasta
source secs mem gz cpu cpu load
Rust 3.84 2,904 1233 3.84 0% 0% 1% 100%
C++ g++ 1.35 1,952 2711 4.18 79% 78% 78% 79%
Rust

rustc 1.25.0 (84203cac6 2018-03-25)

C++ g++

g++ (Ubuntu 7.2.0-8ubuntu3) 7.2.0