The Computer Language
Benchmarks Game

Python 3 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.

regex-redux
source secs mem gz busy cpu load
Python 3 1.36 111,852 1403 2.64 32% 40% 33% 88%
Go 3.94 323,252 810 6.14 74% 30% 19% 33%
pidigits
source secs mem gz busy cpu load
Python 3 1.28 12,024 567 1.29 0% 1% 100% 0%
Go 1.00 8,952 683 1.04 0% 3% 99% 2%
binary-trees
source secs mem gz busy cpu load
Python 3 51.07 278,324 589 178.28 85% 86% 93% 85%
Go 12.80 385,036 1017 43.87 85% 87% 85% 86%
reverse-complement
source secs mem gz busy cpu load
Python 3 7.20 1,005,184 814 10.75 20% 53% 48% 29%
Go 1.42 1,344,600 1338 2.66 57% 36% 71% 24%
k-nucleotide
source secs mem gz busy cpu load
Python 3 46.28 241,108 1967 176.42 94% 97% 95% 96%
Go 8.30 160,300 1607 31.96 96% 98% 96% 95%
fasta
source secs mem gz busy cpu load
Python 3 37.32 846,264 1947 71.03 10% 67% 83% 30%
Go 1.28 11,276 1404 3.78 65% 86% 81% 65%
mandelbrot
source secs mem gz busy cpu load
Python 3 163.32 12,080 688 642.00 98% 98% 98% 98%
Go 3.75 34,832 894 14.92 100% 99% 99% 100%
fannkuch-redux
source secs mem gz busy cpu load
Python 3 352.29 12,232 950 1,392.10 97% 99% 100% 99%
Go 7.59 2,064 969 30.31 100% 100% 100% 100%
spectral-norm
source secs mem gz busy cpu load
Python 3 120.99 13,424 407 479.86 99% 99% 99% 99%
Go 1.44 2,356 548 5.71 99% 99% 99% 99%
n-body
source secs mem gz busy cpu load
Python 3 567.56 8,076 1196 570.95 0% 0% 0% 100%
Go 6.38 1,896 1200 6.43 0% 100% 1% 0%
Python 3

Python 3.9.2

Go

go version go1.16 linux/amd64