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.88 267,168 1807 0.88 1% 0% 0% 100%
C++ g++ 1.02 247,604 2275 1.01 2% 0% 0% 100%
pidigits
source secs mem gz cpu cpu load
Rust 2.52 7,880 1420 2.51 1% 1% 0% 100%
C++ g++ 2.27 3,440 508 2.27 0% 1% 1% 100%
fasta
source secs mem gz cpu cpu load
Rust 5.35 5,908 1211 5.34 1% 1% 1% 100%
C++ g++ 4.21 1,336 1105 4.20 1% 1% 0% 100%
mandelbrot
source secs mem gz cpu cpu load
Rust 26.14 64,980 868 26.11 0% 1% 1% 100%
C++ g++ 20.11 33,768 726 20.10 0% 1% 1% 100%
fannkuch-redux
source secs mem gz cpu cpu load
Rust 48.31 15,956 1191 48.29 1% 1% 2% 100%
C++ g++ 24.65 556 1150 24.64 1% 1% 0% 100%
spectral-norm
source secs mem gz cpu cpu load
Rust 15.72 16,028 1107 15.51 1% 1% 1% 100%
C++ g++ 7.93 2,288 1044 7.92 1% 1% 0% 100%
k-nucleotide
source secs mem gz cpu cpu load
Rust 58.84 166,384 1324 58.78 0% 1% 1% 100%
C++ g++ 24.04 137,908 1252 23.98 1% 1% 0% 100%
n-body
source secs mem gz cpu cpu load
Rust 23.50 5,740 1799 23.49 1% 1% 1% 100%
C++ g++ 8.96 816 1545 8.95 1% 1% 0% 100%
binary-trees
source secs mem gz cpu cpu load
Rust 25.58 122,236 792 25.54 1% 0% 0% 100%
C++ g++ 6.86 76,616 846 6.85 0% 1% 0% 100%
Rust

rustc 1.13.0 (2c6933acc 2016-11-07)

C++ g++

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