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.

n-body
source secs mem gz busy cpu load
Rust 5.98 936 1753 6.10 1% 0% 69% 32%
C gcc 7.30 8 1391 7.33 0% 0% 1% 100%
reverse-complement
source secs mem gz busy cpu load
Rust 1.68 994,588 1330 2.94 47% 25% 79% 24%
C gcc 1.91 532,932 820 2.59 21% 16% 99% 0%
binary-trees
source secs mem gz busy cpu load
Rust 3.37 199,752 721 12.26 100% 88% 88% 87%
C gcc 3.53 168,764 809 11.64 74% 99% 72% 85%
spectral-norm
source secs mem gz busy cpu load
Rust 1.97 2,112 1126 7.87 99% 99% 100% 100%
C gcc 1.98 1,236 569 7.87 99% 99% 99% 99%
pidigits
source secs mem gz busy cpu load
Rust 1.75 3,052 1366 1.79 100% 2% 0% 1%
C gcc 1.75 2,804 452 1.77 0% 100% 0% 1%
fasta
source secs mem gz busy cpu load
Rust 1.51 2,044 1906 4.58 82% 74% 73% 75%
C gcc 1.46 2,976 2268 5.82 99% 100% 99% 99%
mandelbrot
source secs mem gz busy cpu load
Rust 1.70 30,560 1332 6.69 98% 98% 98% 99%
C gcc 1.64 27,016 1135 6.54 100% 99% 100% 100%
k-nucleotide
source secs mem gz busy cpu load
Rust 5.36 135,048 1749 17.00 91% 55% 81% 90%
C gcc 5.09 130,092 1506 16.69 100% 86% 60% 82%
fannkuch-redux
source secs mem gz busy cpu load
Rust 11.08 872 1016 43.55 99% 94% 100% 100%
C gcc 8.74 936 910 34.47 100% 95% 100% 100%
regex-redux
source secs mem gz busy cpu load
Rust 2.12 152,860 986 3.14 84% 17% 31% 17%
C gcc 1.47 152,156 1397 3.46 47% 100% 43% 45%
Rust

rustc 1.42.0 (b8cedc004 2020-03-09)
LLVM version: 9.0

C gcc

gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008