The Computer Language
Benchmarks Game

Go versus Python 3 fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

n-body
source secs mem gz busy cpu load
Go 6.38 1,800 1200 6.44 0% 0% 0% 100%
Python 3 586.17 8,012 1196 589.84 0% 0% 0% 100%
spectral-norm
source secs mem gz busy cpu load
Go 1.43 2,088 548 5.67 99% 99% 99% 99%
Python 3 118.40 22,912 407 470.86 99% 99% 99% 100%
mandelbrot
source secs mem gz busy cpu load
Go 3.75 34,848 894 14.94 99% 100% 99% 99%
Python 3 172.58 12,216 688 689.62 100% 100% 100% 100%
fannkuch-redux
source secs mem gz busy cpu load
Go 8.28 2,428 969 33.10 100% 100% 100% 100%
Python 3 367.49 12,288 950 1,454.68 100% 98% 99% 98%
fasta
source secs mem gz busy cpu load
Go 1.20 11,364 1404 3.67 80% 75% 73% 77%
Python 3 39.10 846,628 1947 70.52 43% 8% 61% 69%
k-nucleotide
source secs mem gz busy cpu load
Go 8.29 160,156 1607 32.00 96% 96% 98% 96%
Python 3 46.37 239,472 1967 176.69 94% 95% 98% 94%
reverse-complement
source secs mem gz busy cpu load
Go 1.43 1,467,392 1338 2.67 48% 38% 55% 45%
Python 3 7.16 1,005,968 814 10.65 20% 53% 47% 29%
binary-trees
source secs mem gz busy cpu load
Go 12.65 431,720 1017 43.57 86% 85% 87% 86%
Python 3 49.35 278,628 589 174.26 95% 86% 86% 86%
pidigits
source secs mem gz busy cpu load
Go 0.86 8,980 683 0.88 2% 0% 0% 100%
Python 3 1.28 12,336 567 1.30 1% 0% 1% 100%
regex-redux
source secs mem gz busy cpu load
Go 3.61 374,916 810 5.95 47% 34% 20% 64%
Python 3 1.36 112,052 1403 2.64 40% 88% 32% 33%
Go

go version go1.15.2 linux/amd64

Python 3

Python 3.9.0