Odin VS Rust benchmarks

Current benchmark data was generated on Mon Dec 30 2024, 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
rust 4.rs 1245ms 9.2ms 33.8MB 1227ms 3ms rustc 1.83.0
rust 5.rs 1324ms 7.0ms 33.8MB 1297ms 10ms rustc 1.83.0
rust 3.rs 1436ms 25ms 49.8MB 1403ms 17ms rustc 1.83.0
odin 1.odin 2347ms 27ms 49.5MB 2313ms 20ms odin 2024

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4.rs 118ms 2.7ms 5.8MB 107ms 0ms rustc 1.83.0
rust 5.rs 126ms 0.6ms 5.8MB 120ms 0ms rustc 1.83.0
rust 3.rs 141ms 4.7ms 7.8MB 127ms 0ms rustc 1.83.0
odin 1.odin 220ms 1.9ms 7.5MB 207ms 0ms odin 2024

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 1.2ms 0.1ms 1.6MB 0ms 0ms odin 2024
rust 1.rs 1.2ms 0.0ms 1.9MB 0ms 0ms rustc 1.85.0-nightly
rust 1.rs 1.3ms 0.1ms 1.8MB 0ms 0ms rustc 1.83.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 32ms 2.1ms 1.9MB 23ms 0ms rustc 1.83.0
rust 1.rs 46ms 1.5ms 2.0MB 37ms 0ms rustc 1.83.0
odin 1.odin 154ms 3.7ms 1.6MB 143ms 0ms odin 2024

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 144ms 14ms 1.9MB 133ms 0ms rustc 1.83.0
rust 1.rs 187ms 10ms 2.0MB 177ms 0ms rustc 1.83.0
odin 1.odin 456ms 2.1ms 1.6MB 443ms 0ms odin 2024

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 23ms 0.8ms 1.9MB 10ms 0ms rustc 1.83.0
rust 1.rs 29ms 2.3ms 1.9MB 20ms 0ms rustc 1.83.0
odin 1.odin 69ms 0.4ms 1.6MB 60ms 0ms odin 2024

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 9.rs 252ms 9.1ms 4.8MB 240ms 0ms rustc 1.85.0-nightly
odin 1.odin 289ms 3.2ms 4.6MB 277ms 0ms odin 2024
rust 8.rs 307ms 1.2ms 4.9MB 297ms 0ms rustc 1.83.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 9.rs 13ms 0.7ms 2.0MB 10ms 0ms rustc 1.85.0-nightly
odin 1.odin 14ms 0.2ms 1.6MB 10ms 0ms odin 2024
rust 8.rs 15ms 0.1ms 2.0MB 10ms 0ms rustc 1.83.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 180ms 29ms 1.8MB 170ms 0ms rustc 1.83.0
rust 7-i.rs 236ms 1.2ms 1.8MB 223ms 0ms rustc 1.83.0
rust 1.rs 238ms 0.9ms 1.8MB 230ms 0ms rustc 1.83.0
rust 2.rs 278ms 0.4ms 1.8MB 270ms 0ms rustc 1.83.0
rust 3.rs 280ms 0.1ms 1.9MB 270ms 0ms rustc 1.85.0-nightly
odin 1.odin 354ms 2.1ms 1.5MB 343ms 0ms odin 2024
odin 1-i.odin 356ms 0.9ms 1.5MB 343ms 0ms odin 2024

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 18ms 0.1ms 1.8MB 10ms 0ms rustc 1.83.0
rust 7-i.rs 26ms 0.2ms 1.8MB 17ms 0ms rustc 1.83.0
rust 1.rs 26ms 0.3ms 1.8MB 17ms 0ms rustc 1.83.0
rust 2.rs 30ms 0.2ms 1.8MB 20ms 0ms rustc 1.83.0
rust 3.rs 30ms 0.2ms 1.8MB 20ms 0ms rustc 1.85.0-nightly
odin 1.odin 37ms 0.5ms 1.5MB 30ms 0ms odin 2024
odin 1-i.odin 39ms 1.4ms 1.5MB 30ms 0ms odin 2024

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 275ms 9.3ms 40.5MB 257ms 3ms odin 2024
rust 1.rs 298ms 8.3ms 40.9MB 280ms 0ms rustc 1.83.0
rust 2.rs 321ms 2.9ms 6.6MB 303ms 0ms rustc 1.83.0
odin 2.odin 707ms 45ms 6.5MB 693ms 0ms odin 2024

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 54ms 1.8ms 11.3MB 40ms 0ms odin 2024
rust 1.rs 60ms 1.9ms 11.6MB 47ms 0ms rustc 1.83.0
rust 2.rs 81ms 1.2ms 2.9MB 70ms 0ms rustc 1.83.0
odin 2.odin 167ms 13ms 2.8MB 157ms 0ms odin 2024

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 496ms 0.3ms 4.6MB 1903ms 3ms rustc 1.85.0-nightly
rust 7-m.rs 497ms 0.4ms 4.2MB 1913ms 7ms rustc 1.83.0
rust 8.rs 1007ms 0.3ms 2.4MB 993ms 0ms rustc 1.85.0-nightly
rust 2-m.rs 1948ms 0.9ms 6.2MB 7640ms 7ms rustc 1.83.0
rust 7.rs 2100ms 7.2ms 1.9MB 2090ms 0ms rustc 1.83.0
odin 1.odin 3581ms 2.1ms 2.9MB 3567ms 0ms odin 2024
rust 2.rs 4189ms 4.1ms 2.0MB 4177ms 0ms rustc 1.83.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 128ms 0.2ms 4.2MB 450ms 13ms rustc 1.85.0-nightly
rust 7-m.rs 128ms 0.1ms 4.1MB 473ms 0ms rustc 1.83.0
rust 8.rs 254ms 0.5ms 2.3MB 247ms 0ms rustc 1.85.0-nightly
rust 2-m.rs 492ms 2.9ms 4.1MB 1880ms 0ms rustc 1.83.0
rust 7.rs 531ms 2.9ms 1.8MB 520ms 0ms rustc 1.83.0
odin 1.odin 899ms 2.3ms 2.3MB 883ms 0ms odin 2024
rust 2.rs 1048ms 0.7ms 1.9MB 1040ms 0ms rustc 1.83.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 35ms 0.4ms 4.2MB 113ms 0ms rustc 1.85.0-nightly
rust 7-m.rs 36ms 0.4ms 4.1MB 107ms 3ms rustc 1.83.0
rust 8.rs 66ms 0.3ms 2.1MB 57ms 0ms rustc 1.85.0-nightly
rust 2-m.rs 128ms 0.5ms 4.1MB 463ms 0ms rustc 1.83.0
rust 7.rs 135ms 2.7ms 1.8MB 127ms 0ms rustc 1.83.0
odin 1.odin 226ms 0.5ms 1.9MB 210ms 0ms odin 2024
rust 2.rs 264ms 0.6ms 1.9MB 250ms 0ms rustc 1.83.0