The Computer Language
Benchmarks Game

PHP versus Ruby fastest programs

by faster benchmark performance

regex-redux
source secs mem gz cpu cpu load
PHP 2.61 270,552 816 2.44 79% 40% 40% 42%
Ruby 15.16 269,680 751 18.83 72% 50% 89% 65%
mandelbrot
source secs mem gz cpu cpu load
PHP 118.28 139,504 875 472.05 100% 100% 100% 100%
Ruby 482.17 96,460 1044 1,914.71 100% 100% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
PHP 38.56 20,848 1152 153.24 99% 100% 99% 99%
Ruby 157.09 86,412 862 594.51 96% 94% 95% 94%
k-nucleotide
source secs mem gz cpu cpu load
PHP 41.29 250,628 1079 134.20 74% 78% 90% 90%
Ruby 108.90 387,100 880 378.11 84% 85% 96% 84%
fannkuch-redux
source secs mem gz cpu cpu load
PHP 227.59 35,536 1160 906.63 100% 99% 99% 100%
Ruby 583.02 58,756 1454 2,266.89 100% 100% 99% 90%
reverse-complement
source secs mem gz cpu cpu load
PHP 12.54 513,344 438 7.51 59% 6% 61% 28%
Ruby 23.53 1,605,140 295 41.31 51% 54% 31% 61%
pidigits
source secs mem gz cpu cpu load
PHP 2.16 10,896 399 2.16 0% 1% 100% 0%
Ruby 3.39 274,164 485 6.82 58% 15% 90% 43%
n-body
source secs mem gz cpu cpu load
PHP 333.78 9,400 1082 333.70 44% 30% 1% 27%
Ruby 389.78 16,440 1137 434.87 13% 90% 6% 3%
fasta
source secs mem gz cpu cpu load
PHP 56.22 9,632 1062 56.20 2% 100% 0% 1%
Ruby 63.70 98,956 1069 106.36 69% 54% 15% 30%
binary-trees
source secs mem gz cpu cpu load
PHP 58.93 765,500 868 214.32 90% 98% 92% 90%
Ruby 38.36 468,512 1107 115.36 73% 70% 94% 66%
PHP

PHP 7.3.0 (cli) (built: Dec 6 2018 12:47:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies

Ruby

ruby 2.6.0preview3 (2018-11-06 trunk 65578) [x86_64-linux]