Codon VS Java 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
java 1.java 73ms 5.0ms 69.5MB 72ms 10ms graal/jvm 17.0.6
java 1.java 79ms 5.0ms 39.2MB 72ms 10ms openjdk 20
java 1.java 81ms 6.4ms 41.7MB 80ms 4ms openjdk 19
java 1.java 118ms 0.9ms 40.0MB 76ms 48ms openjdk/zgc 19

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 552ms 11ms 91.5MB 587ms 23ms graal/jvm 17.0.6
java 1.java 568ms 4.1ms 41.7MB 570ms 20ms openjdk 20
java 1.java 569ms 3.5ms 42.5MB 583ms 13ms openjdk 19
java 1.java 613ms 4.2ms 41.7MB 590ms 43ms openjdk/zgc 19
java 2.java 1893ms 20ms 560.5MB 1923ms 103ms openjdk 20
java 2.java 1917ms 37ms 504.3MB 1953ms 110ms openjdk 19
codon 1.py 1947ms 23ms 5.3MB 1933ms 0ms codon 0.15.4
java 2.java 2583ms 5.9ms 1215.9MB 2013ms 753ms openjdk/zgc 19

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 141ms 2.6ms 88.3MB 177ms 20ms graal/jvm 17.0.6
java 1.java 150ms 5.2ms 40.8MB 160ms 7ms openjdk 20
java 1.java 151ms 5.1ms 42.6MB 167ms 10ms openjdk 19
java 1.java 188ms 3.2ms 44.0MB 160ms 47ms openjdk/zgc 19
codon 1.py 197ms 0.8ms 5.3MB 187ms 0ms codon 0.15.4
java 2.java 416ms 24ms 323.9MB 487ms 63ms openjdk 19
java 2.java 423ms 14ms 292.4MB 500ms 60ms openjdk 20
java 2.java 710ms 38ms 521.9MB 533ms 323ms openjdk/zgc 19

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 727ms 58ms 84.4MB 750ms 20ms openjdk 19
java 1.java 731ms 58ms 82.8MB 750ms 17ms openjdk 20
codon 1.py 873ms 79ms 48.3MB 850ms 3ms codon 0.15.4
java 1.java 886ms 17ms 110.3MB 833ms 87ms openjdk/zgc 19
codon 2.py 1003ms 24ms 106.7MB 977ms 13ms codon 0.15.4
java 2.java 1006ms 4.8ms 50.4MB 1030ms 17ms openjdk 20
java 2.java 1027ms 10ms 50.6MB 1007ms 53ms openjdk/zgc 19
java 2.java 1031ms 14ms 54.2MB 1053ms 13ms openjdk 19
java 1-m.java 1154ms 57ms 242.5MB 1697ms 77ms graal/jvm 17.0.6
java 2-m.java 1762ms 128ms 223.2MB 3120ms 73ms graal/jvm 17.0.6

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
java 1.java 236ms 3.4ms 58.8MB 260ms 10ms openjdk 20
java 1.java 244ms 7.4ms 61.9MB 263ms 13ms openjdk 19
java 1.java 281ms 6.3ms 60.8MB 263ms 50ms openjdk/zgc 19
java 2.java 326ms 2.4ms 44.5MB 360ms 17ms openjdk 20
java 2.java 329ms 2.4ms 48.2MB 360ms 10ms openjdk 19
java 1-m.java 335ms 11ms 143.4MB 473ms 33ms graal/jvm 17.0.6
java 2.java 359ms 9.8ms 46.0MB 347ms 50ms openjdk/zgc 19
java 2-m.java 621ms 17ms 150.6MB 1090ms 43ms graal/jvm 17.0.6