Odin VS Python benchmarks

Current benchmark data was generated on Sat Jan 28 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.)

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 2.0ms 0.7ms 1.7MB 0ms 0ms odin 2023
python 1.py 13ms 0.4ms 7.3MB 10ms 0ms pyston 3.8.12
python 1.py 14ms 1.4ms 8.4MB 10ms 0ms cpython 3.11.1
python 1.py 38ms 3.1ms 51.6MB 14ms 10ms pypy 3.9.16

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1-m.odin 852ms 21ms 46.9MB 1477ms 43ms odin 2023
python 3-m.py 4291ms 242ms 202.2MB 7437ms 357ms pypy 3.9.16
python 3.py timeout 0.0ms 35.0MB 87ms 17ms cpython 3.11.1
python 3.py timeout 0.0ms 34.3MB 73ms 17ms pyston 3.8.12

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 173ms 1.9ms 29.8MB 220ms 20ms odin 2023
python 3-m.py 618ms 72ms 94.3MB 927ms 110ms pypy 3.9.16
python 3-m.py 737ms 14ms 17.6MB 1307ms 20ms pyston 3.8.12
python 3-m.py 843ms 37ms 16.9MB 1520ms 27ms cpython 3.11.1

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 212ms 19ms 77.3MB 177ms 13ms pypy 3.9.16
python 1.py 248ms 4.0ms 78.2MB 207ms 23ms pypy 3.9.16
odin 1.odin 275ms 3.5ms 1.3MB 263ms 0ms odin 2023
python 1.py 976ms 2.0ms 9.0MB 960ms 0ms pyston 3.8.12
python 2.py 1156ms 1.7ms 8.7MB 1140ms 0ms pyston 3.8.12
python 1.py 1300ms 7.9ms 9.3MB 1287ms 0ms cpython 3.11.1
python 2.py 1494ms 5.2ms 9.1MB 1477ms 0ms cpython 3.11.1

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 475ms 2.8ms 77.2MB 443ms 10ms pypy 3.9.16
python 1.py 512ms 11ms 78.8MB 480ms 17ms pypy 3.9.16
odin 1.odin 820ms 9.6ms 1.2MB 807ms 0ms odin 2023
python 1.py 2900ms 12ms 9.0MB 2880ms 3ms pyston 3.8.12
python 2.py 3456ms 28ms 8.8MB 3440ms 0ms pyston 3.8.12
python 1.py 3892ms 45ms 9.5MB 3877ms 0ms cpython 3.11.1
python 2.py 4470ms 72ms 9.1MB 4453ms 0ms cpython 3.11.1

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 112ms 0.5ms 1.2MB 100ms 0ms odin 2023
python 2.py 141ms 3.5ms 77.2MB 110ms 17ms pypy 3.9.16
python 1.py 171ms 15ms 78.2MB 140ms 13ms pypy 3.9.16
python 1.py 476ms 3.0ms 8.7MB 460ms 0ms pyston 3.8.12
python 2.py 539ms 3.6ms 8.2MB 523ms 0ms pyston 3.8.12
python 1.py 619ms 4.0ms 8.9MB 607ms 0ms cpython 3.11.1
python 2.py 745ms 5.0ms 8.4MB 733ms 0ms cpython 3.11.1

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 1585ms 2.5ms 4.5MB 1570ms 0ms odin 2023

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 68ms 0.3ms 1.3MB 60ms 0ms odin 2023

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1-i.odin 529ms 0.2ms 1.2MB 520ms 0ms odin 2023
python 2.py 2692ms 149ms 77.4MB 2660ms 13ms pypy 3.9.16
odin 1.odin 2890ms 20ms 1.2MB 2877ms 0ms odin 2023
python 1.py 3533ms 41ms 76.5MB 3500ms 17ms pypy 3.9.16
python 1.py timeout 0.0ms 8.4MB 4983ms 0ms cpython 3.11.1
python 2.py timeout 0.0ms 8.6MB 4990ms 0ms cpython 3.11.1
python 1.py timeout 0.0ms 8.4MB 4977ms 3ms pyston 3.8.12
python 2.py timeout 0.0ms 8.0MB 4990ms 0ms pyston 3.8.12

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1-i.odin 56ms 2.3ms 1.2MB 50ms 0ms odin 2023
odin 1.odin 290ms 0.2ms 1.2MB 280ms 0ms odin 2023
python 2.py 305ms 26ms 77.0MB 277ms 10ms pypy 3.9.16
python 1.py 400ms 3.4ms 76.4MB 373ms 10ms pypy 3.9.16
python 1.py 1193ms 1.0ms 8.3MB 1180ms 0ms pyston 3.8.12
python 2.py 1636ms 28ms 7.9MB 1623ms 0ms pyston 3.8.12
python 2.py 3404ms 24ms 8.6MB 3393ms 0ms cpython 3.11.1
python 1.py 3437ms 149ms 8.4MB 3423ms 0ms cpython 3.11.1

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 545ms 31ms 40.6MB 520ms 7ms odin 2023
odin 2.odin 1176ms 2.5ms 6.4MB 1163ms 0ms odin 2023
python 1.py 4480ms 211ms 389.1MB 4330ms 133ms pypy 3.9.16
python 1.py timeout 0.0ms 321.1MB 4937ms 50ms cpython 3.11.1
python 2.py timeout 0.0ms 633.6MB 4690ms 293ms cpython 3.11.1
python 2.py timeout 0.0ms 1013.7MB 4620ms 360ms pypy 3.9.16
python 1.py timeout 0.0ms 320.5MB 4897ms 87ms pyston 3.8.12
python 2.py timeout 0.0ms 633.2MB 4577ms 403ms pyston 3.8.12

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 119ms 0.9ms 11.3MB 110ms 0ms odin 2023
odin 2.odin 289ms 3.1ms 2.7MB 277ms 0ms odin 2023
python 1.py 1085ms 58ms 213.2MB 1033ms 37ms pypy 3.9.16
python 2.py 1345ms 7.3ms 164.4MB 1253ms 70ms pyston 3.8.12
python 2.py 1668ms 7.8ms 164.8MB 1593ms 60ms cpython 3.11.1
python 1.py 1746ms 35ms 86.1MB 1713ms 20ms pyston 3.8.12
python 2.py 1769ms 128ms 266.8MB 1623ms 123ms pypy 3.9.16
python 1.py 2971ms 17ms 86.7MB 2933ms 20ms cpython 3.11.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 4615ms 1.6ms 2.7MB 4603ms 0ms odin 2023
python 8.py timeout 0.0ms 16.5MB 57ms 7ms cpython 3.11.1
python 8.py timeout 0.0ms 105.2MB 717ms 120ms pypy 3.9.16
python 8.py timeout 0.0ms 17.7MB 57ms 23ms pyston 3.8.12

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 1156ms 0.1ms 2.1MB 1143ms 0ms odin 2023
python 8.py timeout 0.0ms 18.2MB 113ms 10ms cpython 3.11.1
python 8.py timeout 0.0ms 107.0MB 1267ms 210ms pypy 3.9.16
python 8.py timeout 0.0ms 17.2MB 160ms 20ms pyston 3.8.12

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 291ms 0.1ms 1.8MB 280ms 0ms odin 2023
python 8-m.py 3558ms 133ms 107.0MB 6063ms 373ms pypy 3.9.16
python 8.py timeout 0.0ms 15.9MB 243ms 30ms cpython 3.11.1
python 8.py timeout 0.0ms 17.1MB 357ms 73ms pyston 3.8.12