Odin VS Javascript benchmarks

Current benchmark data was generated on Wed Feb 08 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8171M 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

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 1.js 1662ms 23ms 244.3MB 2067ms 80ms bun 0.5.5
javascript 1.js 4772ms 40ms 260.9MB 3527ms 1607ms node 19.6.0
odin 1.odin timeout 0.0ms 49.5MB 4960ms 17ms odin 2023

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 1.js 158ms 1.8ms 101.8MB 143ms 17ms bun 0.5.5
javascript 1.js 235ms 6.3ms 70.4MB 220ms 23ms node 19.6.0
odin 1.odin 474ms 12ms 7.4MB 457ms 0ms odin 2023

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 2.3ms 0.8ms 1.8MB 0ms 0ms odin 2023
javascript 1.js 20ms 1.3ms 54.3MB 3ms 7ms bun 0.5.5
javascript 1.js 56ms 5.4ms 42.8MB 34ms 10ms node 19.6.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1-m.odin 1106ms 18ms 48.3MB 1940ms 50ms odin 2023

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 232ms 6.4ms 31.1MB 283ms 47ms odin 2023

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 320ms 6.6ms 1.3MB 307ms 0ms odin 2023
javascript 2.js 442ms 6.6ms 54.8MB 420ms 13ms node 19.6.0
javascript 1.js 759ms 10ms 148.3MB 750ms 37ms bun 0.5.5
javascript 2.js 810ms 3.7ms 109.9MB 807ms 33ms bun 0.5.5
javascript 1.js 1210ms 9.1ms 62.3MB 1187ms 17ms node 19.6.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 958ms 3.2ms 1.3MB 943ms 0ms odin 2023
javascript 2.js 1163ms 6.2ms 62.2MB 1143ms 17ms node 19.6.0
javascript 1.js 2115ms 31ms 176.2MB 2150ms 47ms bun 0.5.5
javascript 2.js 2310ms 31ms 117.3MB 2307ms 33ms bun 0.5.5
javascript 1.js 3468ms 2.2ms 62.0MB 3437ms 27ms node 19.6.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 135ms 5.7ms 1.3MB 123ms 0ms odin 2023
javascript 2.js 236ms 4.1ms 49.2MB 227ms 7ms node 19.6.0
javascript 1.js 395ms 6.9ms 117.2MB 377ms 27ms bun 0.5.5
javascript 2.js 437ms 11ms 104.9MB 437ms 27ms bun 0.5.5
javascript 1.js 465ms 5.6ms 50.4MB 453ms 10ms node 19.6.0

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 1680ms 69ms 4.7MB 1667ms 0ms odin 2023

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 74ms 1.5ms 1.3MB 63ms 0ms odin 2023

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1-i.odin 678ms 9.5ms 1.2MB 667ms 0ms odin 2023
javascript 6.js 827ms 4.4ms 47.8MB 810ms 3ms node 19.6.0
javascript 6.js 1241ms 8.9ms 69.6MB 1223ms 13ms bun 0.5.5
odin 1.odin 2787ms 5.6ms 1.3MB 2777ms 0ms odin 2023

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1-i.odin 74ms 6.7ms 1.3MB 63ms 0ms odin 2023
javascript 6.js 136ms 2.8ms 48.2MB 123ms 7ms node 19.6.0
javascript 6.js 152ms 0.7ms 68.3MB 140ms 10ms bun 0.5.5
odin 1.odin 280ms 3.3ms 1.3MB 267ms 0ms odin 2023

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 1010ms 38ms 40.6MB 983ms 10ms odin 2023
odin 2.odin 1241ms 5.4ms 6.5MB 1220ms 3ms odin 2023

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 149ms 2.6ms 11.3MB 133ms 0ms odin 2023
odin 2.odin 303ms 1.0ms 2.6MB 290ms 0ms odin 2023

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6-m.js 3350ms 43ms 69.2MB 6290ms 47ms node 19.6.0
odin 1.odin 4232ms 29ms 2.8MB 4220ms 0ms odin 2023

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6-m.js 1043ms 7.9ms 71.9MB 1807ms 37ms node 19.6.0
odin 1.odin 1068ms 0.4ms 2.0MB 1057ms 0ms odin 2023

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 267ms 0.8ms 1.9MB 257ms 0ms odin 2023
javascript 6.js 467ms 9.8ms 67.2MB 650ms 23ms node 19.6.0