Odin VS V 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
odin 1.odin 1.7ms 0.5ms 0.9MB 0ms 0ms odin 2022
v 1.v 1.7ms 0.4ms 2.1MB 0ms 0ms v/clang 0.3.1
v 1.v 1.9ms 0.8ms 1.9MB 0ms 0ms v/clang+gc 0.3.1

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 182ms 0.8ms 1.9MB 170ms 0ms odin 2022
v 1.v 418ms 0.7ms 2.3MB 407ms 0ms v/clang+gc 0.3.1
v 1.v 428ms 0.8ms 2.3MB 420ms 0ms v/clang 0.3.1

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 545ms 3.0ms 1.9MB 530ms 0ms odin 2022
v 1.v 1248ms 2.5ms 2.3MB 1233ms 0ms v/clang+gc 0.3.1
v 1.v 1280ms 1.9ms 2.3MB 1267ms 0ms v/clang 0.3.1

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 85ms 2.6ms 0.9MB 73ms 0ms odin 2022
v 1.v 135ms 0.5ms 2.3MB 127ms 0ms v/clang+gc 0.3.1
v 1.v 140ms 0.5ms 2.2MB 130ms 0ms v/clang 0.3.1

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 1016ms 2.0ms 2.4MB 1000ms 0ms v/clang+gc 0.3.1
v 1.v 1018ms 1.0ms 2.3MB 1010ms 0ms v/clang 0.3.1
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
v 1.v 105ms 0.8ms 2.3MB 97ms 0ms v/clang+gc 0.3.1
v 1.v 108ms 3.2ms 2.4MB 97ms 0ms v/clang 0.3.1
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
v 2.v 498ms 1.9ms 7.0MB 487ms 0ms v/clang+gc 0.3.1
v 2.v 502ms 2.9ms 10.5MB 483ms 0ms v/clang 0.3.1
v 1.v 696ms 11ms 41.3MB 677ms 3ms v/clang 0.3.1
v 1.v 721ms 25ms 41.2MB 700ms 3ms v/clang+gc 0.3.1
odin 1.odin 726ms 24ms 40.6MB 700ms 10ms odin 2022
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
v 2.v 116ms 0.7ms 3.3MB 110ms 0ms v/clang+gc 0.3.1
v 1.v 118ms 1.1ms 19.3MB 100ms 0ms v/clang+gc 0.3.1
v 2.v 119ms 2.1ms 3.3MB 103ms 0ms v/clang 0.3.1
v 1.v 119ms 0.5ms 19.5MB 100ms 0ms v/clang 0.3.1
odin 1.odin 122ms 0.6ms 11.4MB 110ms 0ms odin 2022
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
v 1.v 4121ms 1.0ms 2.8MB 4110ms 0ms v/clang 0.3.1
v 1.v 4122ms 2.2ms 2.9MB 4110ms 0ms v/clang+gc 0.3.1
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
v 1.v 1033ms 0.4ms 2.6MB 1020ms 0ms v/clang 0.3.1
v 1.v 1033ms 1.1ms 2.6MB 1020ms 0ms v/clang+gc 0.3.1
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
v 1.v 261ms 0.4ms 2.6MB 250ms 0ms v/clang 0.3.1
v 1.v 261ms 0.4ms 2.6MB 250ms 0ms v/clang+gc 0.3.1
odin 1.odin 294ms 3.8ms 1.9MB 280ms 0ms odin 2022