All Go benchmarks

Current benchmark data was generated on Wed Mar 22 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (Model 106)

* -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

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 3676ms 17ms 44.2MB 5217ms 67ms go 1.20.2
1.go 4332ms 6.2ms 50.9MB 4310ms 7ms tinygo 0.27.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 312ms 4.5ms 8.2MB 403ms 7ms go 1.20.2
1.go 409ms 2.0ms 6.9MB 400ms 0ms tinygo 0.27.0

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.go 1182ms 121ms 13.5MB 2297ms 7ms go 1.20.2
1.go 3050ms 2.8ms 253.1MB 2987ms 43ms tinygo 0.27.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.go 79ms 14ms 5.4MB 133ms 0ms go 1.20.2
1.go 485ms 1.1ms 66.8MB 460ms 10ms tinygo 0.27.0

edigits

Input: 250001

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 168ms 3.0ms 8.3MB 153ms 0ms go 1.20.2

Input: 100000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 49ms 1.5ms 8.3MB 40ms 0ms go 1.20.2

fannkuch-redux

Input: 11

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.go 1452ms 1.6ms 4.9MB 2807ms 10ms go 1.20.2
3.go 3212ms 1.0ms 47.8MB 3183ms 10ms tinygo 0.27.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.go 147ms 1.7ms 4.9MB 227ms 0ms go 1.20.2
3.go 425ms 1.1ms 50.1MB 407ms 3ms tinygo 0.27.0

fasta

Input: 2500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.go 252ms 1.3ms 2.9MB 460ms 0ms go 1.20.2

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go 34ms 2.0ms 2.9MB 40ms 0ms go 1.20.2

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 1.1ms 0.5ms 0.0MB 0ms 0ms tinygo 0.27.0
1.go 2.7ms 0.4ms 3.3MB 0ms 0ms go 1.20.2

http-server

Input: 3000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-http2.go 182ms 2.5ms 61.3MB 270ms 33ms go 1.20.2
2-m.go 596ms 17ms 163.5MB 560ms 387ms go 1.20.2
1-m.go 635ms 17ms 166.6MB 620ms 373ms go 1.20.2

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-http2.go 46ms 1.0ms 23.7MB 43ms 10ms go 1.20.2
2.go 148ms 2.3ms 38.4MB 87ms 63ms go 1.20.2
1.go 152ms 23ms 39.9MB 110ms 63ms go 1.20.2

json-serde

Input: sample 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-ffi.go 81ms 7.2ms 37.6MB 57ms 3ms go 1.20.2
1.go 175ms 3.0ms 18.3MB 157ms 3ms go 1.20.2

Input: canada 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-ffi.go 370ms 3.5ms 175.7MB 340ms 70ms go 1.20.2
1.go 1049ms 11ms 101.7MB 1020ms 57ms go 1.20.2

knucleotide

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7-m.go 1496ms 7.0ms 42.9MB 2783ms 27ms go 1.20.2

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7-m.go 252ms 25ms 22.3MB 370ms 20ms go 1.20.2

lru

Input: 1000 1000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go 166ms 0.5ms 0.4MB 157ms 0ms tinygo 0.27.0
3.go 173ms 3.5ms 3.4MB 157ms 0ms go 1.20.2

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go 490ms 0.2ms 0.4MB 480ms 0ms tinygo 0.27.0
3.go 504ms 1.4ms 3.4MB 490ms 0ms go 1.20.2

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go 80ms 0.6ms 0.0MB 70ms 0ms tinygo 0.27.0
3.go 91ms 0.4ms 4.1MB 80ms 0ms go 1.20.2

mandelbrot

Input: 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 4099ms 2.3ms 7.3MB 4083ms 0ms go 1.20.2
1.go timeout 0.0ms 5.6MB 4990ms 0ms tinygo 0.27.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 171ms 0.6ms 2.8MB 160ms 0ms go 1.20.2
1.go 252ms 0.3ms 0.0MB 240ms 0ms tinygo 0.27.0

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 2201ms 19ms 40.0MB 3113ms 43ms go 1.20.2
2.go 2494ms 9.2ms 41.6MB 3587ms 57ms go 1.20.2
2.go 3977ms 9.0ms 120.9MB 3947ms 17ms tinygo 0.27.0
1.go 4128ms 15ms 68.9MB 4093ms 7ms tinygo 0.27.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 476ms 11ms 14.2MB 633ms 17ms go 1.20.2
2.go 535ms 3.6ms 14.6MB 750ms 13ms go 1.20.2
1.go 594ms 0.4ms 22.6MB 580ms 0ms tinygo 0.27.0
2.go 927ms 0.9ms 29.1MB 910ms 0ms tinygo 0.27.0

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 429ms 0.3ms 2.0MB 420ms 0ms tinygo 0.27.0
1.go 459ms 3.6ms 2.9MB 450ms 0ms go 1.20.2

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 45ms 0.3ms 2.0MB 40ms 0ms tinygo 0.27.0
1.go 49ms 2.4ms 2.9MB 40ms 0ms go 1.20.2

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.go 632ms 3.7ms 16.6MB 620ms 0ms tinygo 0.27.0
2.go 915ms 3.0ms 21.8MB 890ms 17ms go 1.20.2
1.go 958ms 45ms 72.7MB 940ms 3ms go 1.20.2
1.go 1001ms 25ms 42.8MB 977ms 7ms tinygo 0.27.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 124ms 1.3ms 21.5MB 107ms 0ms go 1.20.2
1.go 135ms 1.7ms 12.8MB 120ms 0ms tinygo 0.27.0
2.go 147ms 1.5ms 5.4MB 140ms 0ms tinygo 0.27.0
2.go 218ms 0.5ms 7.5MB 210ms 0ms go 1.20.2

pidigits

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8.go 1418ms 9.0ms 10.6MB 1400ms 3ms go 1.20.2

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8.go 343ms 5.2ms 8.5MB 323ms 0ms go 1.20.2

regex-redux

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go timeout 0.0ms 125.7MB 4963ms 90ms go 1.20.2
3.go timeout 0.0ms 106.5MB 4960ms 20ms tinygo 0.27.0

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go 2490ms 1.9ms 20.5MB 2470ms 20ms go 1.20.2
3.go 3139ms 16ms 30.0MB 3117ms 10ms tinygo 0.27.0

secp256k1

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-ffi.go 172ms 2.1ms 9.5MB 157ms 3ms go 1.20.2

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-ffi.go 56ms 2.4ms 9.1MB 40ms 0ms go 1.20.2

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.go 2507ms 25ms 5.4MB 4857ms 3ms go 1.20.2
1.go 4550ms 110ms 5.4MB 4530ms 7ms go 1.20.2
1.go timeout 0.0ms 0.4MB 4987ms 0ms tinygo 0.27.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.go 638ms 5.9ms 2.9MB 1203ms 0ms go 1.20.2
1.go 1199ms 2.7ms 2.9MB 1187ms 0ms go 1.20.2
1.go 2578ms 1.6ms 2.0MB 2563ms 0ms tinygo 0.27.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.go 167ms 0.2ms 2.9MB 300ms 0ms go 1.20.2
1.go 290ms 10ms 2.9MB 277ms 0ms go 1.20.2
1.go 647ms 0.8ms 2.0MB 637ms 0ms tinygo 0.27.0