The Computer Language
Benchmarks Game

Python 3 programs versus Go

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
Python 3 14.87 433,868 486 28.02 32% 45% 84% 29%
Go 29.76 353,332 798 62.56 50% 67% 53% 41%
pidigits
source secs mem gz cpu cpu load
Python 3 3.41 9,992 382 3.40 1% 2% 100% 1%
Go 2.04 10,560 603 2.03 11% 10% 100% 1%
binary-trees
source secs mem gz cpu cpu load
Python 3 126.07 831,740 596 474.55 93% 93% 93% 99%
Go 39.68 364,612 688 150.64 95% 95% 95% 96%
k-nucleotide
source secs mem gz cpu cpu load
Python 3 72.35 229,040 1937 268.72 98% 94% 91% 94%
Go 15.02 149,248 1713 56.88 92% 94% 97% 96%
reverse-complement
source secs mem gz cpu cpu load
Python 3 2.93 265,636 800 4.28 80% 46% 21% 2%
Go 0.48 88,820 1278 0.86 32% 48% 63% 44%
fannkuch-redux
source secs mem gz cpu cpu load
Python 3 501.72 54,708 944 1,967.92 98% 97% 100% 99%
Go 15.84 1,384 900 63.01 99% 100% 100% 100%
n-body
source secs mem gz cpu cpu load
Python 3 836.27 7,756 1181 836.06 0% 1% 1% 100%
Go 21.52 832 1310 21.52 1% 1% 1% 100%
mandelbrot
source secs mem gz cpu cpu load
Python 3 250.62 52,752 686 1,000.26 100% 100% 100% 100%
Go 5.64 31,052 894 22.41 99% 99% 99% 100%
spectral-norm
source secs mem gz cpu cpu load
Python 3 180.01 55,892 437 714.86 99% 100% 99% 100%
Go 3.95 2,156 548 15.70 100% 99% 99% 100%
fasta
source secs mem gz cpu cpu load
Python 3 113.03 7,860 977 112.99 1% 100% 0% 1%
Go 1.98 3,312 1344 5.63 60% 71% 78% 78%
Python 3

Python 3.6.0 (default, Feb 5 2017, 10:29:14) [GCC 5.4.0 20160609] on linux
--enable-optimizations
make profile-opt

Go

go version go1.8 linux/amd64