Php VS Java benchmarks

Current benchmark data was generated on Thu Feb 01 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
java 2.java 450ms 3.2ms 574.3MB 543ms 87ms openjdk 21
java 2-m.java 462ms 4.6ms 646.8MB 650ms 110ms graal/jvm 17.0.8
java 2.java 462ms 4.8ms 588.2MB 563ms 97ms openjdk 23
java 2.java 1178ms 0.9ms 1055.6MB 607ms 733ms openjdk/zgc 21
php 1.php timeout 0.0ms 141.7MB 4960ms 27ms php 8.2.14

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 123ms 1.1ms 166.9MB 147ms 37ms openjdk 21
java 2-m.java 125ms 1.5ms 163.2MB 157ms 33ms openjdk 23
java 2-m.java 168ms 15ms 230.2MB 220ms 70ms graal/jvm 17.0.8
java 2.java 314ms 1.3ms 241.4MB 153ms 213ms openjdk/zgc 21
php 1.php 625ms 4.3ms 63.0MB 593ms 20ms php 8.2.14

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
php 1.php 52ms 1.8ms 52.0MB 14ms 24ms php 8.2.14
java 1.java 66ms 3.1ms 54.7MB 64ms 24ms graal/jvm 17.0.8
java 1.java 73ms 1.9ms 43.8MB 74ms 14ms openjdk 21
java 1.java 73ms 2.7ms 43.9MB 80ms 14ms openjdk 23
java 1.java 189ms 6.4ms 42.6MB 84ms 132ms openjdk/zgc 21

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 399ms 1.6ms 680.1MB 480ms 80ms openjdk 21
java 1.java 400ms 2.6ms 658.4MB 477ms 80ms openjdk 23
java 1-m.java 411ms 5.6ms 638.2MB 593ms 120ms graal/jvm 17.0.8
java 1.java 1027ms 7.4ms 941.0MB 473ms 707ms openjdk/zgc 21
php 1.php 4001ms 93ms 113.7MB 3957ms 27ms php 8.2.14

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 160ms 2.0ms 198.3MB 237ms 33ms openjdk 23
java 1-m.java 164ms 2.2ms 206.7MB 243ms 37ms openjdk 21
java 1-m.java 251ms 4.7ms 257.4MB 403ms 73ms graal/jvm 17.0.8
java 1.java 430ms 21ms 343.8MB 227ms 277ms openjdk/zgc 21
php 1.php 830ms 5.3ms 66.9MB 793ms 20ms php 8.2.14