The Computer Language
Benchmarks Game

Rust versus Go 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.

binary-trees
source secs mem gz busy cpu load
Rust 1.09 198,728 765 3.90 87% 98% 88% 86%
Go 12.23 392,744 1017 41.62 83% 87% 85% 85%
regex-redux
source secs mem gz busy cpu load
Rust 0.77 147,524 2458 1.99 54% 59% 91% 54%
Go 3.85 324,200 810 6.01 27% 19% 20% 91%
mandelbrot
source secs mem gz busy cpu load
Rust 0.93 32,676 763 3.70 100% 99% 100% 100%
Go 3.73 34,192 905 14.85 99% 99% 99% 100%
reverse-complement
source secs mem gz busy cpu load
Rust 0.45 498,964 3040 0.77 25% 23% 100% 25%
Go 1.35 1,560,228 996 2.24 24% 35% 10% 99%
k-nucleotide
source secs mem gz busy cpu load
Rust 2.70 159,048 1691 10.08 93% 92% 91% 99%
Go 7.46 160,328 1607 28.71 98% 95% 95% 97%
spectral-norm
source secs mem gz busy cpu load
Rust 0.72 2,672 1055 2.86 100% 100% 100% 99%
Go 1.43 2,208 548 5.68 99% 99% 100% 99%
n-body
source secs mem gz busy cpu load
Rust 3.29 1,196 1753 3.33 0% 100% 1% 0%
Go 6.38 1,604 1200 6.42 0% 100% 0% 0%
fasta
source secs mem gz busy cpu load
Rust 0.77 1,840 2529 1.59 66% 100% 4% 38%
Go 1.26 11,480 1404 3.89 79% 89% 70% 71%
pidigits
source secs mem gz busy cpu load
Rust 0.71 3,044 799 0.73 1% 0% 1% 100%
Go 1.00 8,808 683 1.03 2% 1% 45% 55%
fannkuch-redux
source secs mem gz busy cpu load
Rust 7.54 1,200 1020 29.78 97% 100% 99% 99%
Go 8.31 2,316 969 33.23 100% 100% 100% 100%
Rust

rustc 1.55.0 (c8dfcfe04 2021-09-06)
LLVM version: 12.0.1

Go

go version go1.17 linux/amd64