Hack VS Java benchmarks

Current benchmark data was generated on Thu Sep 22 2022, 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 664ms 1.0ms 413.9MB 690ms 83ms openjdk 20
java 2.java 690ms 43ms 602.5MB 673ms 120ms openjdk 19
java 2.java 744ms 45ms 680.0MB 807ms 163ms graal/jvm 17.0.4
java 2.java 1277ms 28ms 1069.2MB 903ms 583ms openjdk/zgc 19
hacklang 1.hack timeout 0.0ms 0.0MB 0ms 0ms hhvm 4.169.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 164ms 6.4ms 109.4MB 170ms 23ms openjdk 19
java 2.java 174ms 14ms 111.4MB 163ms 37ms openjdk 20
java 2-m.java 182ms 6.2ms 168.4MB 240ms 40ms graal/jvm 17.0.4
java 2.java 300ms 5.7ms 243.7MB 187ms 153ms openjdk/zgc 19
hacklang 1.hack 1624ms 5.4ms 192.3MB 1550ms 47ms hhvm 4.169.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
hacklang 1.hack 1966ms 4.0ms 178.7MB 1893ms 37ms hhvm 4.169.0
java 1-m.java 4259ms 124ms 932.0MB 7657ms 480ms openjdk/zgc 19
java 1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
java 1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 737ms 38ms 107.3MB 1317ms 30ms openjdk 19
java 1-m.java 840ms 118ms 99.6MB 1487ms 40ms openjdk 20
java 1-m.java 958ms 20ms 311.7MB 1573ms 170ms openjdk/zgc 19
hacklang 1.hack 970ms 4.1ms 182.9MB 913ms 23ms hhvm 4.169.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 70ms 3.1ms 63.4MB 70ms 10ms graal/jvm 17.0.4
java 1.java 78ms 5.0ms 42.7MB 78ms 6ms openjdk 20
java 1.java 82ms 3.6ms 40.8MB 78ms 8ms openjdk 19
java 1.java 119ms 4.8ms 39.9MB 78ms 52ms openjdk/zgc 19
hacklang 1.hack 777ms 2.5ms 169.9MB 716ms 34ms hhvm 4.169.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 495ms 5.0ms 291.5MB 513ms 73ms openjdk 20
java 1.java 512ms 13ms 367.3MB 520ms 83ms openjdk 19
java 1.java 549ms 9.4ms 361.3MB 697ms 87ms graal/jvm 17.0.4
java 1.java 932ms 20ms 758.5MB 643ms 430ms openjdk/zgc 19
hacklang 1.hack timeout 0.0ms 0.0MB 0ms 0ms hhvm 4.169.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 219ms 2.1ms 173.3MB 243ms 37ms openjdk 19
java 1.java 223ms 6.1ms 174.3MB 237ms 43ms openjdk 20
java 1-m.java 267ms 8.9ms 245.9MB 380ms 60ms graal/jvm 17.0.4
java 1.java 433ms 6.0ms 353.0MB 260ms 230ms openjdk/zgc 19
hacklang 1.hack 1805ms 7.5ms 201.3MB 1740ms 40ms hhvm 4.169.0