The Computer Language
Benchmarks Game

Rust programs versus C++ g++

by benchmark task performance

mandelbrot
source secs mem gz cpu cpu load
Rust 1.90 38,724 1160 7.48 98% 98% 99% 98%
C++ g++ 5.82 33,952 726 22.40 96% 95% 95% 100%
regex-redux
source secs mem gz cpu cpu load
Rust 3.28 222,916 804 6.46 33% 100% 32% 35%
C++ g++ 6.02 218,304 848 8.57 15% 100% 14% 15%
k-nucleotide
source secs mem gz cpu cpu load
Rust 5.30 140,364 1728 16.34 100% 86% 55% 70%
C++ g++ 7.15 164,080 1252 24.21 82% 83% 80% 96%
reverse-complement
source secs mem gz cpu cpu load
Rust 0.45 254,232 1324 0.76 25% 26% 28% 98%
C++ g++ 0.59 217,564 2275 0.84 26% 78% 12% 34%
pidigits
source secs mem gz cpu cpu load
Rust 1.75 6,280 1306 1.74 2% 1% 1% 100%
C++ g++ 1.89 3,740 508 1.89 2% 99% 0% 2%
fasta
source secs mem gz cpu cpu load
Rust 1.49 20,324 1887 4.55 75% 76% 75% 82%
C++ g++ 1.47 9,484 2291 5.13 88% 88% 87% 88%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 10.80 20,028 1020 43.07 100% 100% 100% 100%
C++ g++ 10.39 2,592 980 40.76 95% 99% 98% 100%
spectral-norm
source secs mem gz cpu cpu load
Rust 2.36 14,036 1050 9.04 99% 99% 99% 99%
C++ g++ 2.01 1,792 1044 8.00 100% 100% 100% 100%
n-body
source secs mem gz cpu cpu load
Rust 13.08 3,676 1799 13.08 1% 1% 100% 1%
C++ g++ 9.30 1,712 1763 9.29 100% 1% 1% 0%
binary-trees
source secs mem gz cpu cpu load
Rust 4.27 184,600 714 15.84 98% 92% 92% 92%
C++ g++ 2.34 104,212 809 7.58 85% 88% 83% 70%
Rust

rustc 1.16.0 (30cf806ef 2017-03-10)

C++ g++

g++ (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609