Go VS Chapel benchmarks

Current benchmark data was generated on Sun Jan 29 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

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 4.chpl 2288ms 2.0ms 39.5MB 2273ms 7ms chpl 1.29.0
chapel 3.chpl 2480ms 30ms 37.5MB 2453ms 7ms chpl 1.29.0
go 1.go 3040ms 4.2ms 45.1MB 4367ms 53ms go 1.19.5
go 1.go 3913ms 11ms 39.6MB 3890ms 7ms tinygo 0.25.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 4.chpl 222ms 4.9ms 7.3MB 207ms 0ms chpl 1.29.0
chapel 3.chpl 232ms 0.8ms 11.3MB 220ms 0ms chpl 1.29.0
go 1.go 274ms 7.4ms 8.2MB 337ms 7ms go 1.19.5
go 1.go 349ms 1.6ms 7.1MB 337ms 0ms tinygo 0.25.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 736ms 89ms 13.6MB 1430ms 0ms go 1.19.5
go 1.go 1700ms 13ms 257.5MB 1640ms 40ms tinygo 0.25.0
chapel 1-m.chpl 4045ms 127ms 59.5MB 7877ms 30ms chpl 1.29.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 59ms 5.2ms 7.4MB 93ms 0ms go 1.19.5
go 1.go 270ms 1.1ms 66.3MB 250ms 3ms tinygo 0.25.0
chapel 1-m.chpl 275ms 5.3ms 13.7MB 503ms 3ms chpl 1.29.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 93ms 4.0ms 5.7MB 83ms 3ms chpl 1.29.0
go 1.go 166ms 2.0ms 8.2MB 150ms 0ms go 1.19.5

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 44ms 0.3ms 22.8MB 40ms 0ms chpl 1.29.0
go 1.go 49ms 1.7ms 8.2MB 37ms 0ms go 1.19.5

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 1395ms 1.7ms 5.0MB 2700ms 7ms go 1.19.5
go 3.go 2942ms 4.0ms 49.9MB 2917ms 3ms tinygo 0.25.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 144ms 2.6ms 5.0MB 220ms 0ms go 1.19.5
go 3.go 312ms 0.4ms 48.4MB 297ms 3ms tinygo 0.25.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5-m.chpl 147ms 1.7ms 3.8MB 250ms 0ms chpl 1.29.0
go 3-m.go 252ms 2.9ms 4.9MB 460ms 0ms go 1.19.5

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5.chpl 30ms 3.2ms 3.5MB 33ms 0ms chpl 1.29.0
go 3.go 33ms 2.2ms 2.9MB 40ms 0ms go 1.19.5

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 1.4ms 0.5ms 0.1MB 0ms 0ms tinygo 0.25.0
go 1.go 2.6ms 0.4ms 2.9MB 0ms 0ms go 1.19.5
chapel 1.chpl 14ms 3.1ms 2.6MB 15ms 0ms chpl 1.29.0

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-http2.go 162ms 4.1ms 57.5MB 227ms 53ms go 1.19.5
go 1-m.go 583ms 26ms 174.0MB 557ms 353ms go 1.19.5
go 2-m.go 638ms 88ms 180.1MB 650ms 383ms go 1.19.5

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-http2.go 40ms 1.2ms 24.8MB 37ms 13ms go 1.19.5
go 2.go 102ms 33ms 37.4MB 57ms 47ms go 1.19.5
go 1.go 130ms 16ms 36.9MB 90ms 53ms go 1.19.5

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 2-ffi.go 73ms 2.3ms 41.9MB 57ms 10ms go 1.19.5
go 1.go 171ms 4.2ms 20.2MB 157ms 7ms go 1.19.5

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 2-ffi.go 420ms 3.3ms 188.8MB 380ms 123ms go 1.19.5
go 1.go 1078ms 2.7ms 102.5MB 1053ms 57ms go 1.19.5

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3-m.chpl 1017ms 73ms 88.2MB 1800ms 30ms chpl 1.29.0
go 7-m.go 1498ms 12ms 42.0MB 2803ms 20ms go 1.19.5

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3-m.chpl 174ms 13ms 77.8MB 270ms 20ms chpl 1.29.0
go 7-m.go 233ms 8.4ms 24.0MB 363ms 17ms go 1.19.5

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 165ms 0.5ms 0.3MB 160ms 0ms tinygo 0.25.0
go 3.go 175ms 1.8ms 2.9MB 160ms 0ms go 1.19.5

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 490ms 0.1ms 0.3MB 480ms 0ms tinygo 0.25.0
go 3.go 518ms 3.2ms 2.9MB 503ms 0ms go 1.19.5

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 81ms 0.2ms 0.0MB 70ms 0ms tinygo 0.25.0
go 3.go 94ms 2.8ms 3.9MB 87ms 0ms go 1.19.5

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 4384ms 9.5ms 5.4MB 4373ms 0ms go 1.19.5
go 1.go timeout 0.0ms 4.9MB 4990ms 0ms tinygo 0.25.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 185ms 2.5ms 2.9MB 170ms 0ms go 1.19.5
go 1.go 245ms 0.6ms 0.0MB 233ms 0ms tinygo 0.25.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 1997ms 15ms 40.3MB 2810ms 27ms go 1.19.5
go 2.go 2327ms 59ms 41.8MB 3230ms 67ms go 1.19.5
go 1.go 3809ms 7.3ms 213.3MB 3757ms 40ms tinygo 0.25.0
go 2.go timeout 0.0ms 90.8MB 4977ms 10ms tinygo 0.25.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 424ms 6.7ms 12.4MB 573ms 10ms go 1.19.5
go 2.go 492ms 6.9ms 14.7MB 657ms 17ms go 1.19.5
go 1.go 656ms 1.2ms 51.1MB 637ms 3ms tinygo 0.25.0
go 2.go 1264ms 2.6ms 38.6MB 1247ms 3ms tinygo 0.25.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 372ms 2.9ms 2.6MB 363ms 0ms chpl 1.29.0
go 1.go 456ms 1.4ms 2.9MB 440ms 0ms go 1.19.5
go 1.go 843ms 1.0ms 0.0MB 830ms 0ms tinygo 0.25.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 51ms 3.8ms 2.9MB 40ms 0ms go 1.19.5
chapel 2.chpl 55ms 2.2ms 20.2MB 50ms 0ms chpl 1.29.0
go 1.go 86ms 0.6ms 0.0MB 80ms 0ms tinygo 0.25.0

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 2.go 623ms 4.5ms 17.6MB 613ms 0ms tinygo 0.25.0
go 1.go 669ms 21ms 75.2MB 640ms 13ms go 1.19.5
go 1.go 727ms 17ms 43.1MB 707ms 3ms tinygo 0.25.0
go 2.go 904ms 0.7ms 20.0MB 883ms 7ms go 1.19.5

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 121ms 2.3ms 22.1MB 107ms 3ms go 1.19.5
go 1.go 131ms 0.7ms 13.4MB 120ms 0ms tinygo 0.25.0
go 2.go 146ms 0.4ms 5.6MB 140ms 0ms tinygo 0.25.0
go 2.go 216ms 2.8ms 9.1MB 203ms 3ms go 1.19.5

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 592ms 4.7ms 6.1MB 587ms 0ms chpl 1.29.0
go 8.go 1390ms 1.4ms 8.5MB 1367ms 7ms go 1.19.5

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 147ms 1.3ms 3.6MB 140ms 0ms chpl 1.29.0
go 8.go 335ms 5.3ms 8.4MB 317ms 0ms go 1.19.5

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 1984ms 37ms 221.7MB 1840ms 130ms chpl 1.29.0
go 3.go timeout 0.0ms 110.9MB 4963ms 83ms go 1.19.5
go 3.go timeout 0.0ms 120.9MB 4960ms 30ms tinygo 0.25.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 223ms 1.1ms 39.6MB 197ms 17ms chpl 1.29.0
go 3.go 2536ms 6.2ms 17.8MB 2510ms 27ms go 1.19.5
go 3.go timeout 0.0ms 30.2MB 4987ms 0ms tinygo 0.25.0

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 0-ffi.go 173ms 4.1ms 10.1MB 160ms 3ms go 1.19.5
chapel 1.chpl 1534ms 2.5ms 32.3MB 1520ms 3ms chpl 1.29.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 0-ffi.go 57ms 1.2ms 9.6MB 43ms 0ms go 1.19.5
chapel 1.chpl 400ms 2.7ms 32.3MB 387ms 3ms chpl 1.29.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 2252ms 12ms 32.3MB 4413ms 10ms chpl 1.29.0
go 4-m.go 2502ms 32ms 6.9MB 4830ms 3ms go 1.19.5
chapel 1.chpl 4379ms 5.0ms 32.4MB 4373ms 0ms chpl 1.29.0
go 1.go 4961ms 8.6ms 5.5MB 4950ms 0ms go 1.19.5
go 1.go timeout 0.0ms 0.4MB 4987ms 0ms tinygo 0.25.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 583ms 1.8ms 32.7MB 1113ms 3ms chpl 1.29.0
go 4-m.go 632ms 4.9ms 2.9MB 1197ms 0ms go 1.19.5
chapel 1.chpl 1114ms 2.0ms 32.3MB 1100ms 7ms chpl 1.29.0
go 1.go 1248ms 4.9ms 2.9MB 1230ms 0ms go 1.19.5
go 1.go 2584ms 6.9ms 0.0MB 2567ms 0ms tinygo 0.25.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 166ms 1.9ms 32.3MB 287ms 3ms chpl 1.29.0
go 4-m.go 168ms 1.6ms 4.9MB 293ms 0ms go 1.19.5
chapel 1.chpl 296ms 2.0ms 32.3MB 287ms 3ms chpl 1.29.0
go 1.go 316ms 2.0ms 4.9MB 303ms 0ms go 1.19.5
go 1.go 645ms 0.1ms 0.0MB 633ms 0ms tinygo 0.25.0