Php VS Ruby benchmarks

Current benchmark data was generated on Sat Nov 16 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
ruby 1-m.rb 3083ms 2670ms 806.0MB 6603ms 543ms truffleruby 24.1.1
ruby 1.rb 3707ms 64ms 147.1MB 3593ms 93ms ruby/yjit 3.3.6
php 1.php timeout 0.0ms 142.1MB 4957ms 23ms php 8.2.25
ruby 1.rb timeout 0.0ms 78.9MB 4933ms 53ms ruby 3.3.6

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ruby 1.rb 403ms 3.5ms 36.4MB 350ms 37ms ruby/yjit 3.3.6
ruby 1-m.rb 605ms 85ms 432.9MB 1207ms 170ms truffleruby 24.1.1
php 1.php 629ms 22ms 62.9MB 593ms 17ms php 8.2.25
ruby 1.rb 843ms 2.6ms 36.3MB 797ms 33ms ruby 3.3.6

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ruby 1.rb 38ms 0.2ms 164.1MB 18ms 24ms truffleruby 24.1.1
php 1.php 50ms 1.7ms 52.6MB 20ms 18ms php 8.2.25
ruby 1.rb 68ms 1.2ms 28.1MB 40ms 16ms ruby/yjit 3.3.6
ruby 1.rb 71ms 0.4ms 27.9MB 44ms 16ms ruby 3.3.6

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
php 1.php 3826ms 86ms 113.9MB 3780ms 30ms php 8.2.25
ruby 1.rb timeout 0.0ms 88.0MB 4940ms 43ms ruby 3.3.6
ruby 1.rb timeout 0.0ms 88.2MB 4913ms 70ms ruby/yjit 3.3.6
ruby 1.rb timeout 0.0ms 600.6MB 12707ms 390ms truffleruby 24.1.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
php 1.php 832ms 8.5ms 67.2MB 797ms 17ms php 8.2.25
ruby 1-m.rb 2264ms 138ms 544.5MB 5797ms 280ms truffleruby 24.1.1
ruby 1.rb 3024ms 14ms 47.0MB 2983ms 27ms ruby/yjit 3.3.6
ruby 1.rb 4054ms 43ms 46.5MB 4003ms 33ms ruby 3.3.6