Codon VS Python benchmarks

Current benchmark data was generated on Sun Jan 29 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
codon 1.py 4.1ms 0.8ms 5.3MB 0ms 0ms codon 0.15.4
python 1.py 13ms 0.5ms 8.5MB 10ms 0ms cpython 3.11.1
python 1.py 14ms 0.7ms 7.3MB 10ms 0ms pyston 3.8.12
python 1.py 30ms 0.8ms 52.1MB 14ms 6ms pypy 3.9.16

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 1901ms 13ms 77.5MB 1870ms 13ms pypy 3.9.16
codon 1.py 1947ms 23ms 5.3MB 1933ms 0ms codon 0.15.4
python 1.py 3515ms 41ms 76.6MB 3483ms 13ms pypy 3.9.16
python 1.py timeout 0.0ms 8.5MB 4987ms 0ms cpython 3.11.1
python 2.py timeout 0.0ms 8.6MB 4980ms 0ms cpython 3.11.1
python 1.py timeout 0.0ms 8.3MB 4987ms 0ms pyston 3.8.12
python 2.py timeout 0.0ms 8.0MB 4987ms 0ms pyston 3.8.12

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
codon 1.py 197ms 0.8ms 5.3MB 187ms 0ms codon 0.15.4
python 2.py 243ms 1.5ms 77.1MB 220ms 7ms pypy 3.9.16
python 1.py 392ms 1.7ms 76.5MB 370ms 10ms pypy 3.9.16
python 1.py 1193ms 2.2ms 8.3MB 1173ms 0ms pyston 3.8.12
python 2.py 1646ms 27ms 7.9MB 1630ms 0ms pyston 3.8.12
python 2.py 3484ms 156ms 8.6MB 3473ms 0ms cpython 3.11.1
python 1.py 3541ms 305ms 8.5MB 3527ms 0ms cpython 3.11.1

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
codon 1.py 873ms 79ms 48.3MB 850ms 3ms codon 0.15.4
codon 2.py 1003ms 24ms 106.7MB 977ms 13ms codon 0.15.4
python 1.py 3855ms 9.2ms 388.9MB 3733ms 110ms pypy 3.9.16
python 2.py 4940ms 25ms 633.1MB 4617ms 307ms pyston 3.8.12
python 1.py timeout 0.0ms 321.1MB 4930ms 50ms cpython 3.11.1
python 2.py timeout 0.0ms 633.6MB 4710ms 270ms cpython 3.11.1
python 2.py timeout 0.0ms 1013.9MB 4687ms 290ms pypy 3.9.16
python 1.py timeout 0.0ms 320.3MB 4893ms 87ms pyston 3.8.12

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
codon 1.py 150ms 0.2ms 15.1MB 133ms 3ms codon 0.15.4
codon 2.py 185ms 3.8ms 23.9MB 173ms 3ms codon 0.15.4
python 1.py 879ms 18ms 213.2MB 833ms 33ms pypy 3.9.16
python 2.py 1150ms 4.6ms 164.3MB 1083ms 53ms pyston 3.8.12
python 2.py 1427ms 11ms 266.8MB 1317ms 93ms pypy 3.9.16
python 2.py 1657ms 5.2ms 164.9MB 1597ms 43ms cpython 3.11.1
python 1.py 1781ms 26ms 86.1MB 1747ms 17ms pyston 3.8.12
python 1.py 2819ms 23ms 86.8MB 2777ms 20ms cpython 3.11.1