Codon VS Java benchmarks

Current benchmark data was generated on Wed Jan 22 2025, 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.)

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
codon 1.py 4.1ms 0.5ms 5.5MB 0ms 0ms codon 0.17.0
java 1.java 64ms 1.6ms 54.9MB 66ms 18ms graal/jvm 17.0.8
java 1.java 71ms 6.1ms 43.9MB 80ms 16ms openjdk 21
java 1.java 72ms 6.3ms 44.7MB 70ms 20ms openjdk 23
java 1.java 186ms 4.8ms 44.6MB 90ms 126ms openjdk/zgc 21

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 441ms 1.3ms 45.2MB 483ms 17ms openjdk 21
java 1.java 445ms 3.9ms 48.2MB 477ms 23ms openjdk 23
java 1.java 445ms 1.7ms 87.1MB 467ms 30ms graal/jvm 17.0.8
java 1.java 565ms 2.0ms 44.6MB 497ms 127ms openjdk/zgc 21
java 2.java 1252ms 33ms 588.1MB 1390ms 83ms openjdk 21
java 2.java 1255ms 8.3ms 753.6MB 1367ms 107ms openjdk 23
codon 1.py 1371ms 99ms 7.9MB 1357ms 0ms codon 0.17.0
java 2.java 3285ms 56ms 2475.9MB 1647ms 1840ms openjdk/zgc 21

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 118ms 1.2ms 45.1MB 153ms 20ms openjdk 21
java 1.java 123ms 1.7ms 47.9MB 153ms 20ms openjdk 23
java 1.java 123ms 6.2ms 87.3MB 157ms 27ms graal/jvm 17.0.8
codon 1.py 135ms 1.9ms 7.9MB 123ms 0ms codon 0.17.0
java 1.java 237ms 4.3ms 44.7MB 157ms 137ms openjdk/zgc 21
java 2-m.java 299ms 2.8ms 344.9MB 437ms 53ms openjdk 21
java 2-m.java 311ms 5.4ms 346.3MB 443ms 70ms openjdk 23
java 2.java 689ms 16ms 525.9MB 463ms 403ms openjdk/zgc 21

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
codon 1.py 368ms 5.0ms 46.5MB 357ms 0ms codon 0.17.0
java 1.java 402ms 0.4ms 118.1MB 447ms 20ms openjdk 23
java 1.java 409ms 10ms 115.0MB 467ms 17ms openjdk 21
java 1.java 566ms 4.4ms 112.7MB 467ms 160ms openjdk/zgc 21
java 1-m.java 613ms 19ms 236.5MB 893ms 70ms graal/jvm 17.0.8
java 2.java 783ms 1.3ms 57.6MB 843ms 20ms openjdk 21
java 2.java 788ms 14ms 60.7MB 843ms 17ms openjdk 23
java 2.java 838ms 5.5ms 53.0MB 770ms 140ms openjdk/zgc 21
codon 2.py 848ms 3.7ms 100.0MB 830ms 13ms codon 0.17.0
java 2-m.java 1347ms 43ms 203.8MB 2387ms 103ms graal/jvm 17.0.8

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
codon 1.py 71ms 1.3ms 15.3MB 60ms 0ms codon 0.17.0
java 1.java 155ms 5.6ms 68.1MB 207ms 20ms openjdk 23
java 1.java 157ms 1.5ms 64.9MB 207ms 17ms openjdk 21
codon 2.py 198ms 1.5ms 25.9MB 187ms 3ms codon 0.17.0
java 1-m.java 200ms 4.4ms 130.6MB 273ms 43ms graal/jvm 17.0.8
java 2.java 260ms 2.9ms 50.2MB 320ms 23ms openjdk 21
java 2.java 266ms 6.5ms 50.5MB 307ms 23ms openjdk 23
java 1.java 285ms 4.9ms 63.4MB 210ms 140ms openjdk/zgc 21
java 2.java 365ms 1.7ms 47.4MB 303ms 133ms openjdk/zgc 21
java 2-m.java 486ms 11ms 151.2MB 857ms 67ms graal/jvm 17.0.8