Odin VS Python benchmarks

Current benchmark data was generated on Sat Mar 29 2025, 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
python 1.py 1186ms 0.8ms 96.2MB 1120ms 50ms pypy 3.10.16
odin 1.odin 2427ms 38ms 49.5MB 2397ms 13ms odin 2024
python 1.py timeout 0.0ms 40.8MB 4970ms 17ms cpython 3.13.2
python 1.py timeout 0.0ms 40.6MB 4760ms 220ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 98ms 2.9ms 68.8MB 70ms 13ms pypy 3.10.16
odin 1.odin 220ms 1.5ms 7.5MB 210ms 0ms odin 2024
python 1.py 484ms 4.4ms 11.9MB 460ms 10ms pyston 3.8.12
python 1.py 745ms 25ms 12.6MB 737ms 0ms cpython 3.13.2

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 1.1ms 0.1ms 1.6MB 0ms 0ms odin 2024
python 1.py 11ms 0.6ms 7.6MB 0ms 0ms pyston 3.8.12
python 1.py 14ms 1.2ms 8.6MB 10ms 0ms cpython 3.13.2
python 1.py 29ms 0.5ms 51.6MB 8ms 10ms pypy 3.10.16

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 146ms 1.8ms 58.3MB 120ms 10ms pypy 3.10.16
odin 1.odin 157ms 3.5ms 1.6MB 147ms 0ms odin 2024
python 1.py 181ms 2.9ms 59.3MB 153ms 13ms pypy 3.10.16
python 1.py 726ms 9.4ms 8.9MB 713ms 0ms pyston 3.8.12
python 2.py 831ms 7.8ms 8.5MB 817ms 0ms pyston 3.8.12
python 1.py 1180ms 49ms 9.3MB 1170ms 0ms cpython 3.13.2
python 2.py 1336ms 19ms 9.0MB 1323ms 0ms cpython 3.13.2

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 342ms 5.4ms 59.2MB 313ms 10ms pypy 3.10.16
python 1.py 379ms 2.8ms 60.3MB 350ms 13ms pypy 3.10.16
odin 1.odin 461ms 4.1ms 1.6MB 453ms 0ms odin 2024
python 1.py 2144ms 4.0ms 8.9MB 2130ms 0ms pyston 3.8.12
python 2.py 2479ms 16ms 8.5MB 2463ms 0ms pyston 3.8.12
python 1.py 3519ms 155ms 9.3MB 3507ms 0ms cpython 3.13.2
python 2.py 3929ms 97ms 9.0MB 3917ms 0ms cpython 3.13.2

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 72ms 1.8ms 1.6MB 63ms 0ms odin 2024
python 2.py 105ms 2.1ms 58.1MB 83ms 10ms pypy 3.10.16
python 1.py 122ms 3.8ms 58.7MB 97ms 10ms pypy 3.10.16
python 1.py 348ms 2.4ms 8.5MB 337ms 0ms pyston 3.8.12
python 2.py 387ms 3.3ms 8.1MB 373ms 0ms pyston 3.8.12
python 1.py 551ms 21ms 9.0MB 540ms 0ms cpython 3.13.2
python 2.py 640ms 9.1ms 8.8MB 627ms 0ms cpython 3.13.2

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 288ms 3.9ms 4.5MB 280ms 0ms odin 2024

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 14ms 0.3ms 1.7MB 10ms 0ms odin 2024

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 353ms 0.3ms 1.5MB 340ms 0ms odin 2024
odin 1-i.odin 358ms 0.1ms 1.6MB 350ms 0ms odin 2024
python 2.py 1361ms 7.5ms 57.9MB 1337ms 10ms pypy 3.10.16
python 1.py 2657ms 16ms 57.2MB 2630ms 7ms pypy 3.10.16
python 1.py timeout 0.0ms 8.6MB 4990ms 0ms cpython 3.13.2
python 2.py timeout 0.0ms 8.8MB 4987ms 0ms cpython 3.13.2
python 1.py timeout 0.0ms 8.3MB 4990ms 0ms pyston 3.8.12
python 2.py timeout 0.0ms 8.1MB 4987ms 0ms pyston 3.8.12

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 38ms 0.4ms 1.5MB 30ms 0ms odin 2024
odin 1-i.odin 38ms 0.5ms 1.5MB 30ms 0ms odin 2024
python 2.py 180ms 2.3ms 57.9MB 157ms 10ms pypy 3.10.16
python 1.py 303ms 3.6ms 57.1MB 277ms 10ms pypy 3.10.16
python 1.py 945ms 42ms 8.3MB 930ms 0ms pyston 3.8.12
python 2.py 1310ms 7.2ms 8.3MB 1297ms 0ms pyston 3.8.12
python 1.py 3278ms 579ms 8.6MB 3270ms 0ms cpython 3.13.2
python 2.py 3298ms 42ms 8.8MB 3287ms 0ms cpython 3.13.2

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 306ms 3.3ms 40.5MB 287ms 3ms odin 2024
odin 2.odin 745ms 2.4ms 6.5MB 733ms 0ms odin 2024
python 1.py 2599ms 1.4ms 369.5MB 2530ms 57ms pypy 3.10.16
python 2.py 3039ms 28ms 633.0MB 2870ms 157ms pyston 3.8.12
python 1.py 4752ms 17ms 320.4MB 4690ms 47ms pyston 3.8.12
python 1.py timeout 0.0ms 321.1MB 4957ms 27ms cpython 3.13.2
python 2.py timeout 0.0ms 633.6MB 4830ms 153ms cpython 3.13.2
python 2.py timeout 0.0ms 959.9MB 4710ms 273ms pypy 3.10.16

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 61ms 1.9ms 11.2MB 50ms 0ms odin 2024
odin 2.odin 186ms 2.7ms 4.8MB 177ms 0ms odin 2024
python 1.py 540ms 8.7ms 135.2MB 507ms 20ms pypy 3.10.16
python 2.py 769ms 37ms 164.2MB 727ms 30ms pyston 3.8.12
python 1.py 1094ms 28ms 86.0MB 1070ms 7ms pyston 3.8.12
python 2.py 1513ms 103ms 164.8MB 1477ms 23ms cpython 3.13.2
python 2.py 1536ms 8.6ms 290.2MB 1450ms 70ms pypy 3.10.16
python 1.py 2723ms 5.6ms 86.8MB 2700ms 10ms cpython 3.13.2

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 3596ms 0.7ms 2.9MB 3587ms 0ms odin 2024
python 8.py timeout 0.0ms 14.6MB 37ms 7ms cpython 3.13.2
python 8.py timeout 0.0ms 95.4MB 797ms 97ms pypy 3.10.16
python 8.py timeout 0.0ms 14.2MB 33ms 10ms pyston 3.8.12

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 902ms 1.0ms 2.3MB 890ms 0ms odin 2024
python 8.py timeout 0.0ms 14.5MB 53ms 13ms cpython 3.13.2
python 8.py timeout 0.0ms 96.1MB 1303ms 183ms pypy 3.10.16
python 8.py timeout 0.0ms 13.5MB 60ms 20ms pyston 3.8.12

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 229ms 1.5ms 1.9MB 220ms 0ms odin 2024
python 8-m.py 1980ms 4.3ms 93.0MB 6417ms 260ms pypy 3.10.16
python 8.py timeout 0.0ms 14.0MB 97ms 13ms cpython 3.13.2
python 8.py timeout 0.0ms 13.2MB 143ms 40ms pyston 3.8.12