Hack VS Ruby benchmarks

Current benchmark data was generated on Mon Oct 03 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
hacklang 1.hack timeout 0.0ms 0.0MB 0ms 0ms hhvm 4.169.0
ruby 1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.2
ruby 1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2
ruby 1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.2.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ruby 1-m.rb 895ms 44ms 398.0MB 1443ms 123ms truffleruby 22.2.0
ruby 1.rb 905ms 6.4ms 292.0MB 750ms 140ms ruby/yjit 3.1.2
ruby 1.rb 973ms 7.5ms 35.5MB 940ms 13ms ruby 3.1.2
hacklang 1.hack 1624ms 11ms 190.8MB 1550ms 40ms 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 12ms 176.4MB 1900ms 37ms hhvm 4.169.0
ruby 1.rb 3004ms 31ms 336.7MB 2820ms 170ms ruby/yjit 3.1.2
ruby 1.rb 3497ms 38ms 80.1MB 3437ms 47ms ruby 3.1.2
ruby 1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.2.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ruby 1.rb 238ms 2.6ms 42.3MB 213ms 10ms ruby 3.1.2
ruby 1.rb 385ms 0.9ms 298.8MB 220ms 147ms ruby/yjit 3.1.2
hacklang 1.hack 962ms 4.6ms 173.3MB 893ms 37ms hhvm 4.169.0
ruby 1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.2.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ruby 1.rb 42ms 2.5ms 148.7MB 18ms 22ms truffleruby 22.2.0
ruby 1.rb 70ms 0.2ms 30.0MB 48ms 6ms ruby 3.1.2
ruby 1.rb 238ms 0.3ms 286.6MB 94ms 134ms ruby/yjit 3.1.2
hacklang 1.hack 775ms 1.9ms 173.0MB 712ms 38ms hhvm 4.169.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
hacklang 1.hack timeout 0.0ms 0.0MB 0ms 0ms hhvm 4.169.0
ruby 1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.2
ruby 1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2
ruby 1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.2.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
hacklang 1.hack 1794ms 4.0ms 202.3MB 1743ms 27ms hhvm 4.169.0
ruby 1-m.rb 3172ms 18ms 560.6MB 5827ms 207ms truffleruby 22.2.0
ruby 1.rb 3949ms 15ms 300.8MB 3790ms 140ms ruby/yjit 3.1.2
ruby 1.rb 4772ms 16ms 44.3MB 4743ms 13ms ruby 3.1.2