The Computer Language
Benchmarks Game

Rust versus C gcc fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

binary-trees
source secs mem gz busy cpu load
Rust 1.30 111,692 721 4.69 99% 86% 86% 88%
C gcc 1.96 103,240 836 5.52 100% 65% 59% 58%
mandelbrot
source secs mem gz busy cpu load
Rust 0.94 26,316 719 3.71 99% 98% 100% 98%
C gcc 1.26 24,836 1135 5.00 99% 100% 100% 99%
n-body
source secs mem gz busy cpu load
Rust 3.33 688 1753 3.42 0% 100% 2% 1%
C gcc 4.25 8 1391 4.37 100% 0% 2% 0%
k-nucleotide
source secs mem gz busy cpu load
Rust 2.76 132,424 1578 9.03 69% 100% 67% 91%
C gcc 3.43 130,252 1506 11.17 90% 92% 88% 56%
reverse-complement
source secs mem gz busy cpu load
Rust 0.74 994,956 1330 1.36 47% 59% 49% 28%
C gcc 0.86 624,308 820 1.23 27% 18% 99% 0%
fannkuch-redux
source secs mem gz busy cpu load
Rust 6.87 1,016 1016 26.97 100% 99% 94% 100%
C gcc 7.45 692 910 29.11 93% 100% 100% 98%
spectral-norm
source secs mem gz busy cpu load
Rust 0.71 2,436 1126 2.86 100% 100% 100% 100%
C gcc 0.72 1,020 569 2.87 100% 100% 100% 99%
pidigits
source secs mem gz busy cpu load
Rust 0.88 2,884 1306 0.89 1% 0% 0% 100%
C gcc 0.81 2,664 416 0.84 1% 0% 100% 2%
fasta
source secs mem gz busy cpu load
Rust 0.93 2,180 1906 3.08 80% 89% 81% 81%
C gcc 0.82 2,888 2268 3.27 100% 99% 100% 100%
regex-redux
source secs mem gz busy cpu load
Rust 1.28 153,836 986 1.79 13% 83% 13% 31%
C gcc 0.80 148,844 1397 2.03 53% 100% 54% 48%
Rust

rustc 1.44.1 (c7087fe00 2020-06-17)
LLVM version: 9.0

C gcc

gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0