The Computer Language
Benchmarks Game

C gcc versus Rust 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.

regex-redux
source secs mem gz busy cpu load
C gcc 1.47 152,156 1397 3.46 47% 100% 43% 45%
Rust 2.12 153,104 986 3.14 17% 14% 33% 84%
fannkuch-redux
source secs mem gz busy cpu load
C gcc 8.74 936 910 34.47 100% 95% 100% 100%
Rust 11.08 944 1016 43.52 100% 94% 100% 99%
k-nucleotide
source secs mem gz busy cpu load
C gcc 5.09 130,092 1506 16.69 100% 86% 60% 82%
Rust 5.38 135,192 1749 17.05 64% 73% 89% 91%
mandelbrot
source secs mem gz busy cpu load
C gcc 1.64 27,016 1135 6.54 100% 99% 100% 100%
Rust 1.70 30,544 1332 6.69 98% 98% 99% 98%
fasta
source secs mem gz busy cpu load
C gcc 1.46 2,976 2268 5.82 99% 100% 99% 99%
Rust 1.51 2,044 1906 4.60 74% 73% 82% 75%
pidigits
source secs mem gz busy cpu load
C gcc 1.75 2,804 452 1.77 0% 100% 0% 1%
Rust 1.75 3,036 1366 1.77 100% 0% 1% 1%
spectral-norm
source secs mem gz busy cpu load
C gcc 1.98 1,236 569 7.87 99% 99% 99% 99%
Rust 1.98 2,244 1126 7.89 99% 100% 99% 99%
binary-trees
source secs mem gz busy cpu load
C gcc 3.53 168,764 809 11.64 74% 99% 72% 85%
Rust 3.31 199,852 721 12.01 88% 88% 87% 100%
reverse-complement
source secs mem gz busy cpu load
C gcc 1.91 532,932 820 2.59 21% 16% 99% 0%
Rust 1.69 994,564 1330 2.98 45% 26% 47% 59%
n-body
source secs mem gz busy cpu load
C gcc 7.30 8 1391 7.33 0% 0% 1% 100%
Rust 6.07 940 1753 6.16 100% 1% 0% 0%
C gcc

gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008

Rust

rustc 1.40.0 (73528e339 2019-12-16)
LLVM version: 9.0