Go VS Odin benchmarks

Current benchmark data was generated on Mon Dec 30 2024, 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
odin 1.odin 2347ms 27ms 49.5MB 2313ms 20ms odin 2024
go 1-m.go 2686ms 20ms 44.1MB 5690ms 43ms go 1.23.4
go 1.go 2953ms 52ms 52.0MB 2943ms 0ms tinygo 0.35.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 220ms 1.9ms 7.5MB 207ms 0ms odin 2024
go 1.go 231ms 2.2ms 6.5MB 220ms 0ms tinygo 0.35.0
go 1-m.go 238ms 1.6ms 7.9MB 400ms 3ms go 1.23.4

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 751ms 176ms 15.6MB 2937ms 0ms go 1.23.4
go 1.go 1269ms 4.2ms 256.7MB 1237ms 20ms tinygo 0.35.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 38ms 5.2ms 7.5MB 117ms 0ms go 1.23.4
go 1.go 219ms 1.6ms 66.4MB 207ms 0ms tinygo 0.35.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 118ms 1.0ms 10.3MB 107ms 0ms go 1.23.4

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 35ms 0.8ms 8.2MB 30ms 0ms go 1.23.4

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 722ms 1.5ms 5.6MB 2777ms 3ms go 1.23.4
go 3.go 2264ms 1.7ms 50.2MB 2250ms 0ms tinygo 0.35.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 75ms 1.1ms 5.5MB 203ms 0ms go 1.23.4
go 3.go 485ms 1.1ms 47.8MB 470ms 0ms tinygo 0.35.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 127ms 0.6ms 5.4MB 400ms 0ms go 1.23.4

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3-m.go 18ms 0.3ms 5.5MB 37ms 0ms go 1.23.4

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 0.6ms 0.1ms 0.1MB 0ms 0ms tinygo 0.35.0
odin 1.odin 1.2ms 0.1ms 1.6MB 0ms 0ms odin 2024
go 1.go 1.5ms 0.1ms 3.4MB 0ms 0ms go 1.23.4

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-http2.go 111ms 5.8ms 61.7MB 307ms 77ms go 1.23.4
go 2-m.go 482ms 9.0ms 170.4MB 653ms 670ms go 1.23.4
go 1-m.go 483ms 4.9ms 182.5MB 683ms 700ms go 1.23.4

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-http2.go 29ms 2.3ms 29.0MB 57ms 13ms go 1.23.4
go 2-m.go 99ms 6.4ms 40.5MB 87ms 107ms go 1.23.4
go 1-m.go 101ms 11ms 40.3MB 90ms 123ms go 1.23.4

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 2-ffi.go 44ms 1.1ms 42.8MB 30ms 7ms go 1.23.4
go 1.go 144ms 2.9ms 18.4MB 133ms 0ms go 1.23.4

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 2-ffi.go 262ms 2.5ms 150.6MB 240ms 67ms go 1.23.4
go 1.go 776ms 3.7ms 104.8MB 763ms 10ms go 1.23.4

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 7-m.go 775ms 7.7ms 44.0MB 2773ms 17ms go 1.23.4

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 7-m.go 140ms 2.6ms 26.4MB 380ms 20ms go 1.23.4

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 127ms 1.1ms 0.3MB 120ms 0ms tinygo 0.35.0
go 3.go 129ms 0.5ms 3.4MB 120ms 0ms go 1.23.4
odin 1.odin 154ms 3.7ms 1.6MB 143ms 0ms odin 2024

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 377ms 2.7ms 2.1MB 370ms 0ms tinygo 0.35.0
go 3.go 382ms 2.3ms 3.4MB 373ms 0ms go 1.23.4
odin 1.odin 456ms 2.1ms 1.6MB 443ms 0ms odin 2024

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 65ms 2.4ms 2.1MB 57ms 0ms tinygo 0.35.0
go 3.go 69ms 1.3ms 5.4MB 60ms 0ms go 1.23.4
odin 1.odin 69ms 0.4ms 1.6MB 60ms 0ms odin 2024

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 289ms 3.2ms 4.6MB 277ms 0ms odin 2024
go 1.go 2667ms 9.2ms 7.5MB 2657ms 0ms go 1.23.4
go 1.go 3733ms 29ms 5.6MB 3727ms 0ms tinygo 0.35.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 14ms 0.2ms 1.6MB 10ms 0ms odin 2024
go 1.go 119ms 0.5ms 3.4MB 110ms 0ms go 1.23.4
go 1.go 157ms 4.9ms 0.3MB 147ms 0ms tinygo 0.35.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 1594ms 13ms 34.9MB 3240ms 40ms go 1.23.4
go 2-m.go 1816ms 7.2ms 42.9MB 3810ms 43ms go 1.23.4
go 1.go 1992ms 14ms 50.6MB 1977ms 3ms tinygo 0.35.0
go 2.go 2569ms 40ms 119.9MB 2547ms 7ms tinygo 0.35.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 361ms 4.4ms 12.0MB 697ms 27ms go 1.23.4
go 1.go 375ms 0.7ms 13.5MB 360ms 0ms tinygo 0.35.0
go 2-m.go 406ms 2.2ms 14.0MB 820ms 20ms go 1.23.4
go 2.go 551ms 2.1ms 22.7MB 540ms 0ms tinygo 0.35.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 348ms 0.7ms 0.1MB 340ms 0ms tinygo 0.35.0
odin 1.odin 354ms 2.1ms 1.5MB 343ms 0ms odin 2024
odin 1-i.odin 356ms 0.9ms 1.5MB 343ms 0ms odin 2024
go 1.go 363ms 3.4ms 3.4MB 350ms 0ms go 1.23.4

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 36ms 0.1ms 2.1MB 30ms 0ms tinygo 0.35.0
odin 1.odin 37ms 0.5ms 1.5MB 30ms 0ms odin 2024
odin 1-i.odin 39ms 1.4ms 1.5MB 30ms 0ms odin 2024
go 1.go 40ms 1.0ms 3.4MB 30ms 0ms go 1.23.4

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 275ms 9.3ms 40.5MB 257ms 3ms odin 2024
go 1.go 289ms 5.5ms 71.7MB 277ms 0ms go 1.23.4
go 1.go 328ms 8.1ms 42.9MB 313ms 0ms tinygo 0.35.0
go 2.go 439ms 2.4ms 18.0MB 427ms 0ms tinygo 0.35.0
odin 2.odin 707ms 45ms 6.5MB 693ms 0ms odin 2024
go 2.go 782ms 1.4ms 21.8MB 773ms 7ms go 1.23.4

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 54ms 1.8ms 11.3MB 40ms 0ms odin 2024
go 1.go 60ms 4.4ms 21.6MB 47ms 0ms go 1.23.4
go 1.go 65ms 0.8ms 13.0MB 57ms 0ms tinygo 0.35.0
go 2.go 109ms 2.7ms 5.6MB 100ms 0ms tinygo 0.35.0
odin 2.odin 167ms 13ms 2.8MB 157ms 0ms odin 2024
go 2.go 194ms 2.3ms 5.9MB 183ms 0ms go 1.23.4

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 8.go 1118ms 3.4ms 8.5MB 1100ms 7ms go 1.23.4

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 8.go 266ms 3.6ms 8.4MB 247ms 3ms go 1.23.4

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go timeout 0.0ms 124.3MB 4993ms 40ms go 1.23.4
go 3.go timeout 0.0ms 105.0MB 4987ms 0ms tinygo 0.35.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 1783ms 13ms 20.7MB 1773ms 10ms go 1.23.4
go 3.go 2511ms 33ms 29.3MB 2500ms 0ms tinygo 0.35.0

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 0-ffi.go 141ms 1.5ms 14.3MB 130ms 3ms go 1.23.4

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 0-ffi.go 47ms 1.3ms 11.6MB 33ms 0ms go 1.23.4

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 1898ms 18ms 5.5MB 7367ms 0ms go 1.23.4
odin 1.odin 3581ms 2.1ms 2.9MB 3567ms 0ms odin 2024
go 1.go 3660ms 23ms 5.5MB 3653ms 0ms go 1.23.4
go 1.go timeout 0.0ms 2.1MB 4990ms 0ms tinygo 0.35.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 478ms 0.9ms 5.5MB 1820ms 3ms go 1.23.4
odin 1.odin 899ms 2.3ms 2.3MB 883ms 0ms odin 2024
go 1.go 911ms 3.5ms 3.4MB 903ms 0ms go 1.23.4
go 1.go 1391ms 1.3ms 0.4MB 1380ms 0ms tinygo 0.35.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 125ms 1.0ms 5.4MB 443ms 3ms go 1.23.4
odin 1.odin 226ms 0.5ms 1.9MB 210ms 0ms odin 2024
go 1.go 233ms 3.3ms 3.4MB 223ms 0ms go 1.23.4
go 1.go 350ms 0.1ms 0.3MB 340ms 0ms tinygo 0.35.0