Go VS Python benchmarks

Current benchmark data was generated on Sat Mar 29 2025, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][4 cores] AMD EPYC 7763 64-Core Processor (Model 1)

* -m in a file name stands for multi-threading or multi-processing

* -i in a file name stands for direct intrinsics usage. (Usage of simd intrinsics via libraries is not counted)

* -ffi in a file name stands for non-stdlib FFI usage

* (You may find time < time(user) + time(sys) for some non-parallelized programs, the overhead is from GC or JIT compiler, which are allowed to take advantage of multi-cores as that's more close to real-world scenarios.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 1186ms 0.8ms 96.2MB 1120ms 50ms pypy 3.10.16
go 1.go 1256ms 11ms 55.0MB 1230ms 10ms tinygo 0.37.0
go 1-m.go 2402ms 27ms 39.8MB 5327ms 37ms go 1.24.1
python 1.py timeout 0.0ms 40.8MB 4970ms 17ms cpython 3.13.2
python 1.py timeout 0.0ms 40.6MB 4760ms 220ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 98ms 2.9ms 68.8MB 70ms 13ms pypy 3.10.16
go 1.go 114ms 0.9ms 5.6MB 103ms 0ms tinygo 0.37.0
go 1-m.go 211ms 0.7ms 8.0MB 377ms 10ms go 1.24.1
python 1.py 484ms 4.4ms 11.9MB 460ms 10ms pyston 3.8.12
python 1.py 745ms 25ms 12.6MB 737ms 0ms cpython 3.13.2

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 580ms 121ms 15.6MB 2267ms 0ms go 1.24.1
go 1.go 765ms 10ms 268.6MB 710ms 40ms tinygo 0.37.0
python 1.py 1218ms 8.4ms 107.6MB 1167ms 40ms pypy 3.10.16
python 1.py 2748ms 76ms 25.1MB 2727ms 7ms cpython 3.13.2
python 1.py timeout 0.0ms 17.3MB 4980ms 10ms pyston 3.8.12

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 48ms 11ms 7.5MB 157ms 0ms go 1.24.1
go 1.go 72ms 2.9ms 68.6MB 50ms 10ms tinygo 0.37.0
python 1.py 222ms 2.1ms 86.9MB 187ms 17ms pypy 3.10.16
python 1.py 239ms 4.5ms 20.4MB 223ms 3ms cpython 3.13.2
python 1.py 657ms 9.5ms 16.8MB 640ms 7ms pyston 3.8.12

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 118ms 1.1ms 8.4MB 110ms 0ms go 1.24.1
python 1.py 252ms 1.3ms 83.6MB 217ms 23ms pypy 3.10.16
python 1.py 362ms 3.6ms 12.6MB 343ms 0ms cpython 3.13.2
python 1.py 2008ms 3.3ms 9.6MB 1993ms 0ms pyston 3.8.12

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 34ms 1.0ms 8.2MB 27ms 0ms go 1.24.1
python 1.py 101ms 2.1ms 63.3MB 73ms 10ms pypy 3.10.16
python 1.py 110ms 2.5ms 11.6MB 97ms 0ms cpython 3.13.2
python 1.py 351ms 2.5ms 8.9MB 340ms 0ms pyston 3.8.12

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 674ms 1.8ms 3.5MB 2597ms 0ms go 1.24.1
go 3.go 2019ms 0.7ms 48.6MB 2000ms 7ms tinygo 0.37.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 74ms 0.8ms 3.5MB 200ms 0ms go 1.24.1
go 3.go 194ms 2.2ms 48.4MB 180ms 0ms tinygo 0.37.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 126ms 0.7ms 5.5MB 380ms 0ms go 1.24.1
python 1.py 1871ms 16ms 88.8MB 1820ms 37ms pypy 3.10.16
python 5-m.py 2286ms 25ms 65.4MB 3523ms 857ms pypy 3.10.16
python 5-m.py 2628ms 276ms 12.5MB 3513ms 1170ms pyston 3.8.12
python 1.py 3017ms 11ms 8.1MB 3000ms 0ms pyston 3.8.12
python 5-m.py 3415ms 25ms 13.6MB 4547ms 940ms cpython 3.13.2
python 1.py 4761ms 15ms 8.8MB 4747ms 0ms cpython 3.13.2

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 18ms 1.2ms 7.5MB 30ms 0ms go 1.24.1
python 1.py 253ms 1.6ms 63.4MB 220ms 20ms pypy 3.10.16
python 1.py 314ms 5.5ms 8.1MB 303ms 0ms pyston 3.8.12
python 5-m.py 336ms 9.5ms 12.5MB 440ms 160ms pyston 3.8.12
python 5-m.py 404ms 2.2ms 13.5MB 487ms 137ms cpython 3.13.2
python 5-m.py 447ms 0.8ms 65.4MB 747ms 307ms pypy 3.10.16
python 1.py 490ms 12ms 8.8MB 477ms 0ms cpython 3.13.2

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 0.9ms 0.0ms 0.4MB 0ms 0ms tinygo 0.37.0
go 1.go 1.5ms 0.1ms 3.4MB 0ms 0ms go 1.24.1
python 1.py 11ms 0.6ms 7.6MB 0ms 0ms pyston 3.8.12
python 1.py 14ms 1.2ms 8.6MB 10ms 0ms cpython 3.13.2
python 1.py 29ms 0.5ms 51.6MB 8ms 10ms pypy 3.10.16

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-http2.go 123ms 2.3ms 54.1MB 327ms 87ms go 1.24.1
go 1-m.go 422ms 7.0ms 166.6MB 747ms 670ms go 1.24.1
go 2-m.go 430ms 6.7ms 176.9MB 673ms 740ms go 1.24.1
python 1.py 2324ms 184ms 26.6MB 1127ms 1567ms pyston 3.8.12
python 1.py 2773ms 352ms 27.4MB 1603ms 1647ms cpython 3.13.2
python 1.py 4799ms 63ms 105.0MB 2877ms 1247ms pypy 3.10.16

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-http2.go 24ms 13ms 25.5MB 65ms 15ms go 1.24.1
go 2-m.go 72ms 9.5ms 36.3MB 90ms 110ms go 1.24.1
go 1-m.go 81ms 10ms 38.7MB 103ms 120ms go 1.24.1
python 1.py 1102ms 29ms 21.4MB 230ms 297ms pyston 3.8.12
python 1.py 1123ms 32ms 22.8MB 323ms 273ms cpython 3.13.2
python 1.py 1786ms 128ms 85.1MB 727ms 237ms pypy 3.10.16

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 2-ffi.go 46ms 1.2ms 41.1MB 37ms 7ms go 1.24.1
go 1.go 143ms 0.8ms 18.7MB 137ms 0ms go 1.24.1
python 1.py 206ms 5.8ms 38.2MB 173ms 20ms pyston 3.8.12
python 1.py 223ms 2.0ms 38.6MB 197ms 13ms cpython 3.13.2
python 1.py 299ms 2.4ms 89.5MB 267ms 20ms pypy 3.10.16

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 2-ffi.go 252ms 7.1ms 151.4MB 243ms 40ms go 1.24.1
go 1.go 744ms 2.4ms 104.9MB 737ms 7ms go 1.24.1
python 1.py 1848ms 16ms 220.5MB 1673ms 163ms pyston 3.8.12
python 1.py 1936ms 8.2ms 221.4MB 1830ms 90ms cpython 3.13.2
python 1.py 1937ms 15ms 222.2MB 1857ms 67ms pypy 3.10.16

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 7-m.go 692ms 18ms 39.6MB 2383ms 30ms go 1.24.1
python 3-m.py 2432ms 27ms 136.6MB 8243ms 337ms pypy 3.10.16
python 3-m.py 3270ms 50ms 34.3MB 12393ms 110ms pyston 3.8.12
python 3.py timeout 0.0ms 35.7MB 93ms 20ms cpython 3.13.2

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 7-m.go 132ms 5.1ms 23.6MB 347ms 23ms go 1.24.1
python 3-m.py 387ms 3.4ms 76.1MB 970ms 167ms pypy 3.10.16
python 3-m.py 400ms 3.4ms 14.3MB 1323ms 73ms pyston 3.8.12
python 3-m.py 664ms 4.3ms 15.1MB 2327ms 57ms cpython 3.13.2

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 120ms 1.0ms 3.5MB 110ms 0ms go 1.24.1
go 3.go 135ms 1.8ms 0.5MB 127ms 0ms tinygo 0.37.0
python 2.py 146ms 1.8ms 58.3MB 120ms 10ms pypy 3.10.16
python 1.py 181ms 2.9ms 59.3MB 153ms 13ms pypy 3.10.16
python 1.py 726ms 9.4ms 8.9MB 713ms 0ms pyston 3.8.12
python 2.py 831ms 7.8ms 8.5MB 817ms 0ms pyston 3.8.12
python 1.py 1180ms 49ms 9.3MB 1170ms 0ms cpython 3.13.2
python 2.py 1336ms 19ms 9.0MB 1323ms 0ms cpython 3.13.2

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 342ms 5.4ms 59.2MB 313ms 10ms pypy 3.10.16
python 1.py 379ms 2.8ms 60.3MB 350ms 13ms pypy 3.10.16
go 3.go 386ms 3.0ms 0.5MB 377ms 0ms tinygo 0.37.0
go 3.go 389ms 10ms 3.5MB 380ms 0ms go 1.24.1
python 1.py 2144ms 4.0ms 8.9MB 2130ms 0ms pyston 3.8.12
python 2.py 2479ms 16ms 8.5MB 2463ms 0ms pyston 3.8.12
python 1.py 3519ms 155ms 9.3MB 3507ms 0ms cpython 3.13.2
python 2.py 3929ms 97ms 9.0MB 3917ms 0ms cpython 3.13.2

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 50ms 2.0ms 3.5MB 40ms 0ms go 1.24.1
go 3.go 66ms 3.8ms 0.4MB 60ms 0ms tinygo 0.37.0
python 2.py 105ms 2.1ms 58.1MB 83ms 10ms pypy 3.10.16
python 1.py 122ms 3.8ms 58.7MB 97ms 10ms pypy 3.10.16
python 1.py 348ms 2.4ms 8.5MB 337ms 0ms pyston 3.8.12
python 2.py 387ms 3.3ms 8.1MB 373ms 0ms pyston 3.8.12
python 1.py 551ms 21ms 9.0MB 540ms 0ms cpython 3.13.2
python 2.py 640ms 9.1ms 8.8MB 627ms 0ms cpython 3.13.2

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 3235ms 5.1ms 7.7MB 3227ms 0ms go 1.24.1
go 1.go 4074ms 3.0ms 3.4MB 4067ms 0ms tinygo 0.37.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 139ms 2.7ms 3.6MB 130ms 0ms go 1.24.1
go 1.go 174ms 4.6ms 0.5MB 167ms 0ms tinygo 0.37.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 824ms 47ms 63.1MB 803ms 7ms tinygo 0.37.0
go 2.go 1128ms 4.9ms 54.9MB 1107ms 10ms tinygo 0.37.0
go 1-m.go 1480ms 7.2ms 38.8MB 3130ms 43ms go 1.24.1
go 2-m.go 1701ms 23ms 43.0MB 3723ms 43ms go 1.24.1
python 1.py 2248ms 18ms 202.7MB 2120ms 107ms pypy 3.10.16
python 1.py timeout 0.0ms 93.9MB 4960ms 27ms cpython 3.13.2
python 1.py timeout 0.0ms 130.4MB 4937ms 43ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 178ms 1.1ms 9.8MB 167ms 0ms tinygo 0.37.0
go 2.go 206ms 4.8ms 17.2MB 190ms 0ms tinygo 0.37.0
go 1-m.go 334ms 3.1ms 13.9MB 680ms 20ms go 1.24.1
go 2-m.go 375ms 1.8ms 14.0MB 800ms 17ms go 1.24.1
python 1.py 386ms 6.0ms 105.2MB 323ms 47ms pypy 3.10.16
python 1.py 3142ms 32ms 37.1MB 3113ms 13ms cpython 3.13.2
python 1.py timeout 0.0ms 48.8MB 4970ms 20ms pyston 3.8.12

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 348ms 0.1ms 3.5MB 340ms 0ms go 1.24.1
go 1.go 350ms 4.0ms 0.4MB 343ms 0ms tinygo 0.37.0
python 2.py 1361ms 7.5ms 57.9MB 1337ms 10ms pypy 3.10.16
python 1.py 2657ms 16ms 57.2MB 2630ms 7ms pypy 3.10.16
python 1.py timeout 0.0ms 8.6MB 4990ms 0ms cpython 3.13.2
python 2.py timeout 0.0ms 8.8MB 4987ms 0ms cpython 3.13.2
python 1.py timeout 0.0ms 8.3MB 4990ms 0ms pyston 3.8.12
python 2.py timeout 0.0ms 8.1MB 4987ms 0ms pyston 3.8.12

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 37ms 0.7ms 0.4MB 30ms 0ms tinygo 0.37.0
go 1.go 39ms 1.2ms 3.5MB 30ms 0ms go 1.24.1
python 2.py 180ms 2.3ms 57.9MB 157ms 10ms pypy 3.10.16
python 1.py 303ms 3.6ms 57.1MB 277ms 10ms pypy 3.10.16
python 1.py 945ms 42ms 8.3MB 930ms 0ms pyston 3.8.12
python 2.py 1310ms 7.2ms 8.3MB 1297ms 0ms pyston 3.8.12
python 1.py 3278ms 579ms 8.6MB 3270ms 0ms cpython 3.13.2
python 2.py 3298ms 42ms 8.8MB 3287ms 0ms cpython 3.13.2

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 295ms 16ms 39.8MB 277ms 0ms tinygo 0.37.0
go 1.go 300ms 7.4ms 71.7MB 287ms 3ms go 1.24.1
go 2.go 432ms 4.6ms 21.6MB 420ms 0ms tinygo 0.37.0
go 2.go 747ms 4.4ms 21.7MB 733ms 13ms go 1.24.1
python 1.py 2599ms 1.4ms 369.5MB 2530ms 57ms pypy 3.10.16
python 2.py 3039ms 28ms 633.0MB 2870ms 157ms pyston 3.8.12
python 1.py 4752ms 17ms 320.4MB 4690ms 47ms pyston 3.8.12
python 1.py timeout 0.0ms 321.1MB 4957ms 27ms cpython 3.13.2
python 2.py timeout 0.0ms 633.6MB 4830ms 153ms cpython 3.13.2
python 2.py timeout 0.0ms 959.9MB 4710ms 273ms pypy 3.10.16

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 52ms 1.3ms 10.2MB 40ms 0ms tinygo 0.37.0
go 1.go 60ms 4.5ms 21.6MB 50ms 0ms go 1.24.1
go 2.go 106ms 1.4ms 4.9MB 100ms 0ms tinygo 0.37.0
go 2.go 180ms 1.3ms 5.8MB 170ms 0ms go 1.24.1
python 1.py 540ms 8.7ms 135.2MB 507ms 20ms pypy 3.10.16
python 2.py 769ms 37ms 164.2MB 727ms 30ms pyston 3.8.12
python 1.py 1094ms 28ms 86.0MB 1070ms 7ms pyston 3.8.12
python 2.py 1513ms 103ms 164.8MB 1477ms 23ms cpython 3.13.2
python 2.py 1536ms 8.6ms 290.2MB 1450ms 70ms pypy 3.10.16
python 1.py 2723ms 5.6ms 86.8MB 2700ms 10ms cpython 3.13.2

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 8.go 1197ms 8.0ms 8.5MB 1183ms 7ms go 1.24.1
python 4.py 1916ms 3.0ms 8.9MB 1873ms 30ms pyston 3.8.12
python 4.py 1946ms 3.1ms 9.3MB 1893ms 37ms cpython 3.13.2
python 4.py 2189ms 9.6ms 89.4MB 2150ms 27ms pypy 3.10.16

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 8.go 282ms 4.3ms 8.6MB 273ms 0ms go 1.24.1
python 4.py 452ms 3.0ms 8.6MB 440ms 0ms pyston 3.8.12
python 4.py 465ms 2.7ms 9.1MB 453ms 0ms cpython 3.13.2
python 4.py 559ms 4.1ms 83.9MB 520ms 23ms pypy 3.10.16

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 2255ms 3.3ms 243.1MB 2197ms 40ms pypy 3.10.16
python 1.py 4775ms 5.8ms 225.9MB 4573ms 187ms pyston 3.8.12
go 3.go timeout 0.0ms 122.4MB 4980ms 47ms go 1.24.1
go 3.go timeout 0.0ms 122.8MB 4973ms 10ms tinygo 0.37.0
python 1.py timeout 0.0ms 138.1MB 4930ms 53ms cpython 3.13.2

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 330ms 4.3ms 85.6MB 293ms 20ms pypy 3.10.16
python 1.py 501ms 1.3ms 36.2MB 470ms 17ms pyston 3.8.12
python 1.py 607ms 4.5ms 31.1MB 573ms 23ms cpython 3.13.2
go 3.go 1764ms 3.2ms 19.8MB 1753ms 20ms go 1.24.1
go 3.go 2281ms 13ms 26.6MB 2263ms 0ms tinygo 0.37.0

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 0-ffi.go 92ms 0.4ms 5.2MB 83ms 0ms go 1.24.1
python 1.py 3200ms 57ms 8.3MB 3193ms 0ms pyston 3.8.12
python 1.py 3539ms 28ms 74.3MB 3503ms 27ms pypy 3.10.16
python 1.py 3863ms 72ms 8.6MB 3847ms 0ms cpython 3.13.2

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 0-ffi.go 27ms 1.3ms 5.2MB 20ms 0ms go 1.24.1
python 1.py 808ms 5.8ms 8.3MB 797ms 0ms pyston 3.8.12
python 1.py 990ms 9.8ms 8.6MB 980ms 0ms cpython 3.13.2
python 1.py 1000ms 9.6ms 67.3MB 973ms 17ms pypy 3.10.16

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 1901ms 1.6ms 5.5MB 7417ms 3ms go 1.24.1
go 1.go 3665ms 8.1ms 5.6MB 3660ms 0ms go 1.24.1
go 1.go timeout 0.0ms 0.5MB 4990ms 0ms tinygo 0.37.0
python 8.py timeout 0.0ms 14.6MB 37ms 7ms cpython 3.13.2
python 8.py timeout 0.0ms 95.4MB 797ms 97ms pypy 3.10.16
python 8.py timeout 0.0ms 14.2MB 33ms 10ms pyston 3.8.12

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 482ms 2.2ms 5.6MB 1837ms 3ms go 1.24.1
go 1.go 918ms 5.1ms 3.5MB 907ms 0ms go 1.24.1
go 1.go 1397ms 0.3ms 0.5MB 1390ms 0ms tinygo 0.37.0
python 8.py timeout 0.0ms 14.5MB 53ms 13ms cpython 3.13.2
python 8.py timeout 0.0ms 96.1MB 1303ms 183ms pypy 3.10.16
python 8.py timeout 0.0ms 13.5MB 60ms 20ms pyston 3.8.12

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 125ms 0.6ms 5.5MB 453ms 0ms go 1.24.1
go 1.go 234ms 0.8ms 3.5MB 227ms 0ms go 1.24.1
go 1.go 351ms 0.2ms 0.4MB 340ms 0ms tinygo 0.37.0
python 8-m.py 1980ms 4.3ms 93.0MB 6417ms 260ms pypy 3.10.16
python 8.py timeout 0.0ms 14.0MB 97ms 13ms cpython 3.13.2
python 8.py timeout 0.0ms 13.2MB 143ms 40ms pyston 3.8.12