All Go benchmarks

Current benchmark data was generated on Fri Dec 09 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz (Model 85)

* -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 3073ms 26ms 46.1MB 4390ms 63ms go 1.19.4
1.go 4563ms 15ms 38.9MB 4540ms 7ms tinygo 0.25.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 269ms 4.2ms 8.2MB 343ms 7ms go 1.19.4
1.go 343ms 1.1ms 6.9MB 330ms 0ms tinygo 0.25.0

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.go 833ms 18ms 13.6MB 1620ms 3ms go 1.19.4
1.go 2147ms 9.1ms 255.8MB 2063ms 67ms tinygo 0.25.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.go 61ms 12ms 5.4MB 103ms 0ms go 1.19.4
1.go 297ms 1.7ms 66.8MB 270ms 13ms tinygo 0.25.0

edigits

Input: 250001

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 163ms 2.1ms 10.3MB 143ms 3ms go 1.19.4

Input: 100000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 50ms 1.1ms 8.4MB 37ms 0ms go 1.19.4

fannkuch-redux

Input: 11

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.go 1200ms 3.9ms 5.0MB 2313ms 7ms go 1.19.4
3.go 2697ms 0.3ms 48.9MB 2677ms 3ms tinygo 0.25.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go 124ms 0.5ms 5.0MB 183ms 0ms go 1.19.4
3.go 296ms 0.2ms 50.0MB 270ms 10ms tinygo 0.25.0

fasta

Input: 2500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.go 207ms 1.0ms 2.9MB 373ms 0ms go 1.19.4

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go 28ms 0.2ms 2.9MB 30ms 0ms go 1.19.4

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 2.0ms 1.5ms 0.0MB 0ms 0ms tinygo 0.25.0
1.go 2.6ms 0.3ms 2.9MB 0ms 0ms go 1.19.4

http-server

Input: 3000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-http2.go 186ms 2.3ms 54.1MB 260ms 63ms go 1.19.4
2-m.go 635ms 16ms 166.8MB 583ms 420ms go 1.19.4
1-m.go 668ms 33ms 167.1MB 653ms 437ms go 1.19.4

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-http2.go 20ms 17ms 22.7MB 30ms 10ms go 1.19.4
2.go 134ms 11ms 38.9MB 80ms 63ms go 1.19.4
1.go 146ms 10ms 38.8MB 93ms 77ms go 1.19.4

json-serde

Input: sample 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-ffi.go 79ms 0.8ms 43.8MB 57ms 13ms go 1.19.4
1.go 177ms 3.5ms 18.8MB 170ms 0ms go 1.19.4

Input: canada 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-ffi.go 384ms 3.3ms 183.7MB 363ms 63ms go 1.19.4
1.go 1046ms 3.8ms 102.9MB 1027ms 43ms go 1.19.4

knucleotide

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7-m.go 1348ms 9.0ms 41.4MB 2503ms 30ms go 1.19.4

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
7-m.go 230ms 2.6ms 23.3MB 350ms 20ms go 1.19.4

lru

Input: 1000 1000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go 160ms 0.5ms 0.3MB 150ms 0ms tinygo 0.25.0
3.go 168ms 1.5ms 5.4MB 153ms 0ms go 1.19.4

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go 474ms 0.3ms 2.0MB 460ms 0ms tinygo 0.25.0
3.go 490ms 0.4ms 3.4MB 480ms 0ms go 1.19.4

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go 81ms 1.4ms 2.0MB 70ms 0ms tinygo 0.25.0
3.go 88ms 1.0ms 3.6MB 77ms 0ms go 1.19.4

mandelbrot

Input: 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 3945ms 2.6ms 7.4MB 3933ms 0ms go 1.19.4
1.go timeout 0.0ms 0.0MB 0ms 0ms tinygo 0.25.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 169ms 3.9ms 2.9MB 157ms 0ms go 1.19.4
1.go 328ms 0.4ms 0.0MB 313ms 0ms tinygo 0.25.0

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 2063ms 13ms 38.2MB 2897ms 43ms go 1.19.4
2.go 2351ms 22ms 50.8MB 3327ms 70ms go 1.19.4
1.go 3811ms 13ms 167.4MB 3757ms 37ms tinygo 0.25.0
2.go timeout 0.0ms 0.0MB 0ms 0ms tinygo 0.25.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 444ms 4.3ms 12.1MB 587ms 20ms go 1.19.4
2.go 498ms 2.2ms 13.0MB 673ms 17ms go 1.19.4
2.go 1153ms 3.6ms 38.6MB 1137ms 0ms tinygo 0.25.0
1.go 1212ms 4.1ms 51.6MB 1193ms 7ms tinygo 0.25.0

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 504ms 1.6ms 2.9MB 490ms 0ms go 1.19.4
1.go 704ms 1.1ms 0.0MB 690ms 0ms tinygo 0.25.0

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 53ms 0.6ms 2.9MB 43ms 0ms go 1.19.4
1.go 74ms 1.5ms 2.0MB 60ms 0ms tinygo 0.25.0

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.go 679ms 1.5ms 17.4MB 667ms 0ms tinygo 0.25.0
1.go 797ms 13ms 73.9MB 760ms 23ms go 1.19.4
2.go 929ms 2.1ms 20.0MB 917ms 3ms go 1.19.4
1.go 1010ms 43ms 42.9MB 987ms 7ms tinygo 0.25.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.go 132ms 4.5ms 24.2MB 117ms 0ms go 1.19.4
1.go 134ms 7.1ms 13.1MB 123ms 0ms tinygo 0.25.0
2.go 162ms 2.3ms 5.6MB 150ms 0ms tinygo 0.25.0
2.go 216ms 1.2ms 7.3MB 200ms 0ms go 1.19.4

pidigits

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8.go 1330ms 1.6ms 8.5MB 1310ms 7ms go 1.19.4

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8.go 321ms 3.1ms 8.4MB 303ms 0ms go 1.19.4

regex-redux

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go timeout 0.0ms 0.0MB 0ms 0ms go 1.19.4
3.go timeout 0.0ms 0.0MB 0ms 0ms tinygo 0.25.0

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3.go 2451ms 29ms 18.4MB 2417ms 33ms go 1.19.4
3.go timeout 0.0ms 0.0MB 0ms 0ms tinygo 0.25.0

secp256k1

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-ffi.go 150ms 1.8ms 9.5MB 140ms 3ms go 1.19.4

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
0-ffi.go 48ms 0.5ms 9.6MB 37ms 0ms go 1.19.4

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.go 2204ms 4.7ms 5.4MB 4280ms 3ms go 1.19.4
1.go 4400ms 1.3ms 5.4MB 4387ms 3ms go 1.19.4
1.go timeout 0.0ms 0.0MB 0ms 0ms tinygo 0.25.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.go 563ms 2.5ms 3.4MB 1060ms 0ms go 1.19.4
1.go 1111ms 2.0ms 2.9MB 1100ms 0ms go 1.19.4
1.go timeout 0.0ms 0.0MB 0ms 0ms tinygo 0.25.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4-m.go 149ms 2.5ms 2.9MB 260ms 0ms go 1.19.4
1.go 280ms 0.2ms 2.9MB 270ms 0ms go 1.19.4
1.go 1639ms 2.2ms 0.0MB 1627ms 0ms tinygo 0.25.0