The Computer Language
Benchmarks Game

Rust versus C clang 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,180 721 4.34 87% 87% 88% 100%
C clang 7.49 351,380 908 27.01 98% 90% 83% 90%
mandelbrot
source secs mem gz busy cpu load
Rust 0.92 32,716 763 3.66 100% 99% 100% 100%
C clang 3.49 29,336 822 13.95 100% 100% 100% 100%
regex-redux
source secs mem gz busy cpu load
Rust 1.28 153,400 986 1.76 14% 29% 83% 12%
C clang 3.10 103,020 1115 3.10 0% 0% 100% 0%
reverse-complement
source secs mem gz busy cpu load
Rust 0.75 995,164 1330 1.37 60% 49% 47% 26%
C clang 1.08 994,240 750 1.60 87% 29% 13% 20%
fannkuch-redux
source secs mem gz busy cpu load
Rust 6.88 1,224 1016 26.99 94% 99% 99% 100%
C clang 9.79 972 1557 37.60 98% 97% 100% 90%
fasta
source secs mem gz busy cpu load
Rust 0.93 2,332 1906 3.07 88% 82% 80% 81%
C clang 1.29 744 1281 1.30 1% 0% 1% 99%
n-body
source secs mem gz busy cpu load
Rust 3.31 836 1767 3.38 1% 1% 1% 100%
C clang 3.32 8 1391 3.43 0% 100% 0% 3%
pidigits
source secs mem gz busy cpu load
Rust 0.74 2,968 1366 0.75 1% 0% 0% 100%
C clang 0.73 2,820 416 0.73 100% 0% 0% 0%
spectral-norm
source secs mem gz busy cpu load
Rust 0.72 2,504 1055 2.85 100% 99% 99% 100%
C clang   Make Error
k-nucleotide
source secs mem gz busy cpu load
Rust 3.22 131,280 1578 10.56 92% 89% 73% 74%
C clang   Make Error
Rust

rustc 1.47.0 (18bf6b4f0 2020-10-07)
LLVM version: 9.0

C clang

Ubuntu clang version 11.0.0-2