Codon VS C benchmarks

Current benchmark data was generated on Thu Jul 13 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
c 1.c 1.8ms 0.5ms 1.4MB 0ms 0ms zigcc 0.11.0-dev.3978+711b4e93e
c 1.c 1.9ms 0.8ms 1.3MB 0ms 0ms gcc 13.1.0
c 1.c 1.9ms 0.5ms 1.4MB 0ms 0ms clang 14.0.0
codon 1.py 4.0ms 0.6ms 5.1MB 0ms 0ms codon 0.16.2

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 2.c 312ms 0.6ms 1.3MB 300ms 0ms gcc 13.1.0
c 5.c 315ms 2.8ms 1.0MB 307ms 0ms zigcc 0.11.0-dev.3978+711b4e93e
c 5.c 320ms 0.8ms 1.3MB 310ms 0ms gcc 13.1.0
c 8-i.c 320ms 0.4ms 1.3MB 310ms 0ms gcc 13.1.0
c 2.c 320ms 0.2ms 1.0MB 310ms 0ms zigcc 0.11.0-dev.3978+711b4e93e
c 5.c 331ms 2.0ms 1.4MB 320ms 0ms clang 14.0.0
c 2.c 341ms 0.6ms 1.4MB 327ms 0ms clang 14.0.0
c 8-i.c 361ms 0.1ms 1.0MB 350ms 0ms zigcc 0.11.0-dev.3978+711b4e93e
c 8-i.c 367ms 5.2ms 1.4MB 357ms 0ms clang 14.0.0
codon 1.py 1947ms 41ms 7.2MB 1933ms 0ms codon 0.16.2

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 5.c 34ms 0.5ms 1.0MB 23ms 0ms zigcc 0.11.0-dev.3978+711b4e93e
c 8-i.c 34ms 0.1ms 1.3MB 30ms 0ms gcc 13.1.0
c 5.c 34ms 0.3ms 1.3MB 27ms 0ms gcc 13.1.0
c 2.c 35ms 1.7ms 1.3MB 23ms 0ms gcc 13.1.0
c 2.c 35ms 0.1ms 1.0MB 23ms 0ms zigcc 0.11.0-dev.3978+711b4e93e
c 5.c 36ms 0.5ms 1.4MB 30ms 0ms clang 14.0.0
c 2.c 37ms 0.3ms 1.4MB 30ms 0ms clang 14.0.0
c 8-i.c 38ms 0.2ms 1.0MB 30ms 0ms zigcc 0.11.0-dev.3978+711b4e93e
c 8-i.c 40ms 1.2ms 1.4MB 30ms 0ms clang 14.0.0
codon 1.py 198ms 2.4ms 7.3MB 190ms 0ms codon 0.16.2

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 1.c 604ms 35ms 40.8MB 577ms 10ms clang 14.0.0
c 1.c 610ms 8.4ms 40.9MB 580ms 13ms gcc 13.1.0
c 1.c 642ms 41ms 40.1MB 613ms 13ms zigcc 0.11.0-dev.3978+711b4e93e
codon 1.py 682ms 64ms 44.5MB 657ms 10ms codon 0.16.2
codon 2.py 911ms 35ms 104.9MB 883ms 13ms codon 0.16.2

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 1.c 123ms 3.8ms 11.6MB 107ms 0ms clang 14.0.0
c 1.c 124ms 3.7ms 11.0MB 107ms 0ms zigcc 0.11.0-dev.3978+711b4e93e
c 1.c 127ms 4.4ms 11.7MB 117ms 0ms gcc 13.1.0
codon 1.py 150ms 1.1ms 15.1MB 140ms 0ms codon 0.16.2
codon 2.py 202ms 0.9ms 25.6MB 183ms 7ms codon 0.16.2