Odin VS Nim benchmarks

Current benchmark data was generated on Thu Sep 22 2022, 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.)

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 1.3ms 0.1ms 0.9MB 0ms 0ms nim/clang 1.6.6
odin 1.odin 1.7ms 0.5ms 0.9MB 0ms 0ms odin 2022
nim 1.nim 2.2ms 0.8ms 0.7MB 0ms 0ms nim 1.6.6

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 149ms 4.5ms 1.0MB 140ms 0ms nim/clang 1.6.6
nim 2.nim 154ms 0.7ms 0.7MB 140ms 0ms nim 1.6.6
odin 1.odin 182ms 0.8ms 1.9MB 170ms 0ms odin 2022
nim 1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.6
nim 1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.6

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 436ms 5.6ms 0.9MB 423ms 0ms nim/clang 1.6.6
nim 2.nim 455ms 0.8ms 0.7MB 443ms 0ms nim 1.6.6
odin 1.odin 545ms 3.0ms 1.9MB 530ms 0ms odin 2022
nim 1.nim timeout 0.0ms 0.0MB 0ms 0ms nim 1.6.6
nim 1.nim timeout 0.0ms 0.0MB 0ms 0ms nim/clang 1.6.6

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 64ms 1.4ms 1.0MB 50ms 0ms nim/clang 1.6.6
nim 2.nim 67ms 1.0ms 0.7MB 60ms 0ms nim 1.6.6
odin 1.odin 85ms 2.6ms 0.9MB 73ms 0ms odin 2022
nim 1.nim 416ms 6.8ms 1.0MB 403ms 0ms nim/clang 1.6.6
nim 1.nim 465ms 5.6ms 0.7MB 453ms 0ms nim 1.6.6

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 405ms 0.6ms 0.9MB 390ms 0ms nim/clang 1.6.6
nim 2.nim 428ms 0.4ms 1.0MB 420ms 0ms nim 1.6.6
odin 1.odin 2502ms 1.7ms 0.9MB 2490ms 0ms odin 2022

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 44ms 0.7ms 1.0MB 30ms 0ms nim/clang 1.6.6
nim 2.nim 46ms 0.3ms 1.0MB 37ms 0ms nim 1.6.6
odin 1.odin 253ms 0.8ms 0.9MB 240ms 0ms odin 2022

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 2.nim 588ms 1.5ms 6.8MB 577ms 0ms nim/clang 1.6.6
nim 2.nim 671ms 3.4ms 6.1MB 663ms 0ms nim 1.6.6
odin 1.odin 726ms 24ms 40.6MB 700ms 10ms odin 2022
nim 1.nim 744ms 0.6ms 40.2MB 727ms 0ms nim 1.6.6
nim 1.nim 824ms 35ms 41.0MB 803ms 3ms nim/clang 1.6.6
odin 2.odin 1160ms 1.8ms 6.3MB 1143ms 3ms odin 2022

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 122ms 2.1ms 11.1MB 110ms 0ms nim 1.6.6
odin 1.odin 122ms 0.6ms 11.4MB 110ms 0ms odin 2022
nim 1.nim 129ms 0.4ms 11.4MB 120ms 0ms nim/clang 1.6.6
nim 2.nim 140ms 1.0ms 3.3MB 130ms 0ms nim/clang 1.6.6
nim 2.nim 159ms 1.2ms 2.9MB 150ms 0ms nim 1.6.6
odin 2.odin 283ms 0.6ms 2.8MB 270ms 0ms odin 2022

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 4122ms 1.4ms 1.9MB 4110ms 0ms nim 1.6.6
nim 1.nim 4122ms 4.1ms 1.8MB 4110ms 0ms nim/clang 1.6.6
odin 1.odin 4618ms 1.5ms 2.9MB 4607ms 0ms odin 2022

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 1033ms 1.0ms 1.0MB 1020ms 0ms nim/clang 1.6.6
nim 1.nim 1033ms 0.4ms 1.0MB 1020ms 0ms nim 1.6.6
odin 1.odin 1158ms 0.3ms 2.3MB 1147ms 0ms odin 2022

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
nim 1.nim 260ms 0.2ms 1.0MB 250ms 0ms nim/clang 1.6.6
nim 1.nim 261ms 1.2ms 1.0MB 250ms 0ms nim 1.6.6
odin 1.odin 294ms 3.8ms 1.9MB 280ms 0ms odin 2022