The Computer Language
Benchmarks Game

Rust versus C gcc fastest programs

Always look at the source code.

These are only the fastest programs. Do some of them use manually vectorized SIMD? 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.45 499,168 3040 0.76 24% 22% 23% 100%
C gcc 0.86 698,264 820 1.27 1% 18% 100% 28%
binary-trees
source secs mem gz busy cpu load
Rust 1.04 198,652 765 3.71 86% 85% 100% 86%
C gcc 1.79 168,760 809 5.35 64% 64% 71% 100%
mandelbrot
source secs mem gz busy cpu load
Rust 0.92 32,240 757 3.66 100% 99% 99% 100%
C gcc 1.27 31,692 1135 5.08 100% 100% 100% 99%
k-nucleotide
source secs mem gz busy cpu load
Rust 2.78 159,256 1691 10.20 90% 90% 90% 97%
C gcc 3.81 130,112 1506 12.18 54% 87% 79% 100%
n-body
source secs mem gz busy cpu load
Rust 3.31 844 1767 3.32 0% 0% 0% 100%
C gcc 4.30 8 1391 4.32 0% 0% 0% 100%
fannkuch-redux
source secs mem gz busy cpu load
Rust 7.15 1,172 1020 28.09 99% 95% 100% 99%
C gcc 7.52 836 910 29.37 99% 100% 93% 99%
regex-redux
source secs mem gz busy cpu load
Rust 0.77 146,736 2458 2.00 90% 54% 55% 61%
C gcc 0.80 152,196 1397 2.03 48% 100% 54% 53%
fasta
source secs mem gz busy cpu load
Rust 0.77 1,820 2529 1.54 99% 99% 1% 1%
C gcc 0.78 1,220 1463 0.79 1% 0% 0% 100%
spectral-norm
source secs mem gz busy cpu load
Rust 0.71 2,544 932 2.85 99% 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.88 2,940 1366 0.88 100% 0% 0% 0%
C gcc 0.73 2,848 416 0.75 1% 100% 1% 0%
Rust

rustc 1.50.0 (cb75ad5db 2021-02-10)
LLVM version 11.0.0

C gcc

gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0