The Computer Language
Benchmarks Game

PHP programs versus Ruby

by benchmark task performance

mandelbrot
source secs mem gz cpu cpu load
PHP 41.86 50,972 863 41.83 0% 1% 1% 100%
Ruby 222.26 7,012 307 222.17 1% 0% 0% 100%
k-nucleotide
source secs mem gz cpu cpu load
PHP 163.07 149,888 1060 161.59 1% 1% 1% 100%
Ruby 672.83 160,276 420 672.50 0% 2% 99% 100%
n-body
source secs mem gz cpu cpu load
PHP 420.03 7,016 1082 419.91 1% 1% 1% 100%
Ruby 1,429.79 7,284 1137 1,429.24 1% 18% 83% 100%
fasta
source secs mem gz cpu cpu load
PHP 59.04 7,196 1030 59.02 0% 4% 1% 100%
Ruby 197.80 197,072 904 197.62 1% 1% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
PHP 159.77 15,420 1135 159.71 1% 1% 1% 100%
Ruby 520.06 7,584 326 519.86 0% 1% 100% 100%
fannkuch-redux
source secs mem gz cpu cpu load
PHP 1,135.14 7,008 441 1,134.86 1% 1% 1% 100%
Ruby 2,604.22 7,112 384 2,603.32 1% 17% 72% 100%
pidigits
source secs mem gz cpu cpu load
PHP 2.81 8,264 394 2.80 0% 1% 1% 100%
Ruby 4.04 626,044 478 4.02 0% 1% 1% 100%
reverse-complement
source secs mem gz cpu cpu load
PHP 4.68 375,464 297 4.67 0% 0% 2% 100%
Ruby 6.17 541,352 509 6.14 0% 1% 1% 100%
binary-trees
source secs mem gz cpu cpu load
PHP 164.95 1,137,716 483 164.80 1% 1% 1% 100%
Ruby 179.60 117,640 402 179.49 1% 1% 100% 100%
PHP

PHP 7.0.6 (cli) (built: May 4 2016 12:35:58) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

Ruby

ruby 2.3.0p0 (2015-12-25 revision 53290) [i686-linux]