The Computer Language
22.01 Benchmarks Game

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

binary-trees
source secs mem gz busy cpu load
Rust 1.11 198,404 765 3.93 86% 98% 86% 85%
Go 12.48 659,828 666 49.71 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%
Go 3.80 324,536 810 6.06 30% 19% 91% 20%
mandelbrot
source secs mem gz busy cpu load
Rust 0.91 32,676 757 3.63 100% 99% 99% 100%
Go 3.73 33,904 905 14.86 100% 99% 99% 100%
reverse-complement
source secs mem gz busy cpu load
Rust 0.45 498,736 3040 0.78 26% 48% 76% 24%
Go 1.34 1,610,444 996 2.20 21% 99% 15% 30%
k-nucleotide
source secs mem gz busy cpu load
Rust 2.69 159,044 1691 10.00 92% 97% 92% 92%
Go 7.46 160,048 1607 28.57 96% 95% 95% 98%
n-body
source secs mem gz busy cpu load
Rust 2.90 1,052 1874 2.98 0% 1% 100% 1%
Go 6.37 1,160 1200 6.42 0% 0% 0% 100%
fannkuch-redux
source secs mem gz busy cpu load
Rust 3.80 1,352 1253 15.13 100% 99% 99% 99%
Go 8.31 2,272 969 33.19 100% 100% 100% 100%
spectral-norm
source secs mem gz busy cpu load
Rust 0.71 2,488 932 2.85 100% 100% 99% 100%
Go 1.43 1,992 548 5.68 99% 99% 99% 100%
fasta
source secs mem gz busy cpu load
Rust 0.77 1,996 2529 1.56 100% 1% 4% 99%
Go 1.27 11,520 1404 3.81 66% 84% 77% 74%
pidigits
source secs mem gz busy cpu load
Rust 0.70 2,580 799 0.70 0% 100% 0% 0%
Go 0.86 9,188 683 0.90 99% 3% 1% 1%
Rust

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

Go

go version go1.17.6 linux/amd64