Php VS Java benchmarks

Current benchmark data was generated on Sat Jan 28 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.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 665ms 6.1ms 412.0MB 690ms 70ms openjdk 20
java 2.java 719ms 58ms 602.2MB 703ms 117ms openjdk 19
java 2.java 760ms 59ms 667.2MB 823ms 147ms graal/jvm 17.0.6
java 2.java 1276ms 25ms 1068.3MB 903ms 577ms openjdk/zgc 19
php 1.php timeout 0.0ms 141.1MB 4953ms 33ms php 8.2.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 167ms 1.7ms 109.0MB 167ms 30ms openjdk 19
java 2.java 169ms 16ms 108.4MB 163ms 20ms openjdk 20
java 2-m.java 172ms 3.9ms 157.8MB 217ms 43ms graal/jvm 17.0.6
java 2.java 295ms 1.6ms 248.7MB 197ms 137ms openjdk/zgc 19
php 1.php 781ms 1.5ms 62.3MB 750ms 17ms php 8.2.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
php 1.php 48ms 3.8ms 51.3MB 22ms 10ms php 8.2.1
java 1.java 76ms 6.2ms 63.1MB 70ms 10ms graal/jvm 17.0.6
java 1.java 79ms 3.3ms 39.3MB 74ms 10ms openjdk 20
java 1.java 81ms 3.7ms 41.3MB 76ms 8ms openjdk 19
java 1.java 119ms 4.3ms 39.7MB 76ms 48ms openjdk/zgc 19

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 505ms 22ms 369.4MB 543ms 47ms openjdk 19
java 1.java 534ms 50ms 290.5MB 547ms 53ms openjdk 20
java 1.java 574ms 78ms 352.8MB 723ms 90ms graal/jvm 17.0.6
java 1.java 951ms 43ms 764.9MB 647ms 437ms openjdk/zgc 19
php 1.php 4853ms 20ms 113.5MB 4810ms 23ms php 8.2.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 216ms 5.7ms 173.4MB 240ms 30ms openjdk 19
java 1.java 234ms 11ms 222.3MB 227ms 57ms openjdk 20
java 1-m.java 270ms 4.6ms 281.7MB 367ms 67ms graal/jvm 17.0.6
java 1.java 432ms 11ms 354.8MB 253ms 223ms openjdk/zgc 19
php 1.php 1068ms 0.8ms 66.4MB 1030ms 23ms php 8.2.1