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.20 200,160 721 4.27 87% 86% 86% 98%
C gcc 1.97 134,432 836 5.58 59% 66% 59% 100%
mandelbrot
source secs mem gz busy cpu load
Rust 0.92 26,112 757 3.67 100% 100% 100% 100%
C gcc 1.26 24,836 1135 5.00 99% 100% 100% 99%
k-nucleotide
source secs mem gz busy cpu load
Rust 2.64 131,408 1578 8.41 66% 86% 92% 75%
C gcc 3.43 130,252 1506 11.17 90% 92% 88% 56%
n-body
source secs mem gz busy cpu load
Rust 3.42 1,844 1753 3.44 100% 0% 0% 0%
C gcc 4.25 8 1391 4.37 100% 0% 2% 0%
reverse-complement
source secs mem gz busy cpu load
Rust 0.74 994,912 1330 1.34 27% 81% 46% 27%
C gcc 0.86 624,308 820 1.23 27% 18% 99% 0%
spectral-norm
source secs mem gz busy cpu load
Rust 0.72 2,448 817 2.84 100% 99% 100% 99%
C gcc 0.72 1,020 569 2.87 100% 100% 100% 99%
fannkuch-redux
source secs mem gz busy cpu load
Rust 7.54 1,012 1016 29.62 95% 98% 100% 100%
C gcc 7.45 692 910 29.11 93% 100% 100% 98%
pidigits
source secs mem gz busy cpu load
Rust 0.88 2,904 1420 0.90 0% 100% 2% 0%
C gcc 0.81 2,664 416 0.84 1% 0% 100% 2%
fasta
source secs mem gz busy cpu load
Rust 0.94 2,180 1961 3.12 81% 81% 81% 89%
C gcc 0.82 2,888 2268 3.27 100% 99% 100% 100%
regex-redux
source secs mem gz busy cpu load
Rust 1.30 153,228 986 1.82 12% 85% 28% 15%
C gcc 0.80 148,844 1397 2.03 53% 100% 54% 48%
Rust

rustc 1.46.0 (04488afe3 2020-08-24)
LLVM version: 9.0

C gcc

gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0