The Computer Language
22.01 Benchmarks Game

Rust versus C gcc fastest programs

Always look at the source code. These are only the fastest programs.

If they are manually vectorized SIMD, does the host language matter? You might not be interested in the most optimised programs.

Look at "mandelbrot" or "spectral-norm" or other measurement tables. Look at the other programs. Choose which programs you want to compare.

fannkuch-redux
source secs mem gz busy cpu load
Rust 3.80 1,352 1253 15.13 100% 99% 99% 99%
C gcc 7.58 1,048 910 29.67 99% 100% 94% 99%
k-nucleotide
source secs mem gz busy cpu load
Rust 2.69 159,044 1691 10.00 92% 97% 92% 92%
C gcc 3.96 130,000 1506 12.52 74% 54% 99% 90%
binary-trees
source secs mem gz busy cpu load
Rust 1.11 198,404 765 3.93 86% 98% 86% 85%
C gcc 1.58 168,780 809 4.58 100% 62% 67% 62%
mandelbrot
source secs mem gz busy cpu load
Rust 0.91 32,676 757 3.63 100% 99% 99% 100%
C gcc 1.30 30,924 1135 5.18 100% 100% 100% 100%
regex-redux
source secs mem gz busy cpu load
Rust 0.78 146,632 2458 2.01 56% 60% 90% 53%
C gcc 0.80 152,240 1397 2.06 97% 55% 50% 56%
fasta
source secs mem gz busy cpu load
Rust 0.77 1,996 2529 1.56 100% 1% 4% 99%
C gcc 0.78 1,244 1463 0.82 0% 1% 4% 100%
reverse-complement
source secs mem gz busy cpu load
Rust 0.45 498,736 3040 0.78 26% 48% 76% 24%
C gcc 0.41 499,072 1965 0.59 15% 90% 22% 17%
pidigits
source secs mem gz busy cpu load
Rust 0.70 2,580 799 0.70 0% 100% 0% 0%
C gcc 0.56 2,440 1090 2.26 100% 100% 100% 100%
n-body
source secs mem gz busy cpu load
Rust 2.90 1,052 1874 2.98 0% 1% 100% 1%
C gcc 2.13 992 1633 2.22 1% 1% 2% 100%
spectral-norm
source secs mem gz busy cpu load
Rust 0.71 2,488 932 2.85 100% 100% 99% 100%
C gcc 0.41 1,016 1197 1.60 98% 95% 98% 95%
Rust

rustc 1.58.0 (02072b482 2022-01-11)
LLVM version: 13.0.0

C gcc

gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0