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.08 198,580 765 3.81 85% 99% 86% 84%
Go 12.80 385,036 1017 43.87 85% 87% 85% 86%
regex-redux
source secs mem gz busy cpu load
Rust 0.77 145,284 2458 1.98 53% 90% 53% 60%
Go 3.94 323,252 810 6.14 74% 30% 19% 33%
mandelbrot
source secs mem gz busy cpu load
Rust 0.93 32,644 763 3.71 100% 100% 100% 100%
Go 3.75 34,832 894 14.92 100% 99% 99% 100%
reverse-complement
source secs mem gz busy cpu load
Rust 0.45 499,076 3040 0.95 24% 100% 24% 62%
Go 1.42 1,344,600 1338 2.66 57% 36% 71% 24%
k-nucleotide
source secs mem gz busy cpu load
Rust 2.68 159,112 1691 10.01 99% 91% 92% 92%
Go 8.30 160,300 1607 31.96 96% 98% 96% 95%
spectral-norm
source secs mem gz busy cpu load
Rust 0.71 2,568 1055 2.84 100% 99% 99% 100%
Go 1.44 2,356 548 5.71 99% 99% 99% 99%
n-body
source secs mem gz busy cpu load
Rust 3.42 840 1753 4.20 100% 16% 4% 4%
Go 6.38 1,896 1200 6.43 0% 100% 1% 0%
fasta
source secs mem gz busy cpu load
Rust 0.77 1,816 2529 1.53 99% 1% 0% 99%
Go 1.28 11,276 1404 3.78 65% 86% 81% 65%
pidigits
source secs mem gz busy cpu load
Rust 0.71 2,644 799 0.72 0% 0% 100% 1%
Go 1.00 8,952 683 1.04 0% 3% 99% 2%
fannkuch-redux
source secs mem gz busy cpu load
Rust 7.53 1,172 1020 29.57 99% 98% 100% 95%
Go 7.59 2,064 969 30.31 100% 100% 100% 100%
Rust

rustc 1.52.0 (88f19c6da 2021-05-03)
LLVM version: 12.0.0

Go

go version go1.16 linux/amd64