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.

mandelbrot
source secs mem gz busy cpu load
Rust 0.93 32,788 763 3.69 100% 100% 99% 100%
C clang 2.09 31,812 694 8.34 100% 100% 100% 100%
k-nucleotide
source secs mem gz busy cpu load
Rust 2.76 159,224 1691 10.20 90% 98% 91% 90%
C clang 6.01 128,788 1506 12.85 24% 44% 54% 92%
reverse-complement
source secs mem gz busy cpu load
Rust 0.46 499,024 3040 0.83 26% 80% 47% 28%
C clang 0.99 741,472 820 3.94 100% 100% 99% 100%
binary-trees
source secs mem gz busy cpu load
Rust 1.07 198,540 765 3.76 84% 100% 84% 83%
C clang 1.92 169,416 809 6.15 77% 79% 72% 93%
fannkuch-redux
source secs mem gz busy cpu load
Rust 7.28 1,168 1016 28.82 100% 97% 100% 100%
C clang 9.85 964 1557 37.34 90% 95% 93% 100%
fasta
source secs mem gz busy cpu load
Rust 0.77 1,848 2529 1.57 99% 1% 4% 100%
C clang 0.82 3,816 2268 3.26 99% 99% 100% 100%
regex-redux
source secs mem gz busy cpu load
Rust 0.78 146,236 2458 1.99 53% 53% 61% 90%
C clang 0.82 154,084 1397 2.80 82% 83% 79% 96%
n-body
source secs mem gz busy cpu load
Rust 3.31 836 1767 3.36 100% 1% 0% 1%
C clang 3.33 8 1391 3.46 1% 2% 1% 100%
spectral-norm
source secs mem gz busy cpu load
Rust 0.71 2,696 1055 2.86 100% 100% 100% 100%
C clang 0.72 3,056 1139 2.87 100% 100% 100% 100%
pidigits
source secs mem gz busy cpu load
Rust 0.74 2,888 1420 0.76 0% 0% 100% 3%
C clang 0.73 2,820 416 0.72 0% 99% 0% 0%
Rust

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

C clang

Ubuntu clang version 11.0.0-2