Odin VS C++ 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
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
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
cpp 1.cpp 1.0ms 0.1ms 1.4MB 0ms 0ms g++ 11.4.0
odin 1.odin 1.2ms 0.1ms 1.6MB 0ms 0ms odin 2024
cpp 1.cpp 1.5ms 0.1ms 2.1MB 0ms 0ms clang++ 14.0.0-1ubuntu1.1

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
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
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
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
odin 1.odin 289ms 3.2ms 4.6MB 277ms 0ms odin 2024

Input: 1000

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

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
cpp 0-i.cpp 166ms 0.2ms 1.5MB 160ms 0ms g++ 11.4.0
cpp 0-i.cpp 170ms 0.3ms 2.3MB 160ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 1.cpp 313ms 1.5ms 2.3MB 303ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 1.cpp 315ms 1.9ms 1.8MB 303ms 0ms g++ 11.4.0
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
cpp 0-i.cpp 18ms 0.1ms 1.5MB 10ms 0ms g++ 11.4.0
cpp 0-i.cpp 19ms 0.1ms 2.3MB 10ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 1.cpp 34ms 0.6ms 2.3MB 27ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 1.cpp 34ms 0.8ms 1.8MB 20ms 0ms g++ 11.4.0
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
cpp 1.cpp 481ms 0.5ms 7.3MB 470ms 0ms g++ 11.4.0
cpp 1.cpp 529ms 2.1ms 7.8MB 517ms 0ms clang++ 14.0.0-1ubuntu1.1
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
cpp 1.cpp 119ms 1.3ms 3.6MB 110ms 0ms g++ 11.4.0
cpp 1.cpp 130ms 0.7ms 4.1MB 120ms 0ms clang++ 14.0.0-1ubuntu1.1
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
cpp 8-m.cpp 476ms 13ms 5.3MB 1823ms 3ms clang++ 14.0.0-1ubuntu1.1
cpp 8-m.cpp 484ms 4.4ms 4.2MB 1877ms 0ms g++ 11.4.0
cpp 6-im.cpp 917ms 1.1ms 4.2MB 3600ms 0ms g++ 11.4.0
cpp 6-im.cpp 922ms 11ms 5.4MB 3593ms 0ms clang++ 14.0.0-1ubuntu1.1
odin 1.odin 3581ms 2.1ms 2.9MB 3567ms 0ms odin 2024

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
cpp 8-m.cpp 124ms 0.6ms 5.4MB 450ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 8-m.cpp 133ms 9.6ms 4.1MB 487ms 0ms g++ 11.4.0
cpp 6-im.cpp 239ms 0.9ms 5.4MB 900ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 6-im.cpp 239ms 0.4ms 4.1MB 907ms 0ms g++ 11.4.0
odin 1.odin 899ms 2.3ms 2.3MB 883ms 0ms odin 2024

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
cpp 8-m.cpp 38ms 1.2ms 7.3MB 107ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 8-m.cpp 39ms 0.3ms 4.0MB 120ms 0ms g++ 11.4.0
cpp 6-im.cpp 70ms 3.2ms 4.0MB 240ms 0ms g++ 11.4.0
cpp 6-im.cpp 71ms 2.8ms 7.2MB 230ms 0ms clang++ 14.0.0-1ubuntu1.1
odin 1.odin 226ms 0.5ms 1.9MB 210ms 0ms odin 2024