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.

reverse-complement
source secs mem gz busy cpu load
Rust 0.46 499,024 3040 0.83 26% 80% 47% 28%
C gcc 0.86 698,264 820 1.27 1% 18% 100% 28%
binary-trees
source secs mem gz busy cpu load
Rust 1.07 198,540 765 3.76 84% 100% 84% 83%
C gcc 1.79 168,760 809 5.35 64% 64% 71% 100%
k-nucleotide
source secs mem gz busy cpu load
Rust 2.76 159,224 1691 10.20 90% 98% 91% 90%
C gcc 3.81 130,112 1506 12.18 54% 87% 79% 100%
mandelbrot
source secs mem gz busy cpu load
Rust 0.93 32,788 763 3.69 100% 100% 99% 100%
C gcc 1.27 31,692 1135 5.08 100% 100% 100% 99%
n-body
source secs mem gz busy cpu load
Rust 3.31 836 1767 3.36 100% 1% 0% 1%
C gcc 4.30 8 1391 4.32 0% 0% 0% 100%
fasta
source secs mem gz busy cpu load
Rust 0.77 1,848 2529 1.57 99% 1% 4% 100%
C gcc 0.82 2,896 2268 3.26 99% 100% 100% 99%
fannkuch-redux
source secs mem gz busy cpu load
Rust 7.28 1,168 1016 28.82 100% 97% 100% 100%
C gcc 7.52 836 910 29.37 99% 100% 93% 99%
regex-redux
source secs mem gz busy cpu load
Rust 0.78 146,236 2458 1.99 53% 53% 61% 90%
C gcc 0.80 152,196 1397 2.03 48% 100% 54% 53%
spectral-norm
source secs mem gz busy cpu load
Rust 0.71 2,696 1055 2.86 100% 100% 100% 100%
C gcc 0.72 1,100 569 2.86 100% 99% 100% 100%
pidigits
source secs mem gz busy cpu load
Rust 0.74 2,888 1420 0.76 0% 0% 100% 3%
C gcc 0.73 2,848 416 0.75 1% 100% 1% 0%
Rust

rustc 1.48.0 (7eac88abb 2020-11-16)
LLVM version: 11.0

C gcc

gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0