The Computer Language
Benchmarks Game

Ruby versus PHP fastest programs

by faster benchmark performance

binary-trees
source secs mem gz cpu cpu load
Ruby 64.07 488,156 1107 218.34 98% 78% 90% 83%
PHP 58.93 765,500 868 214.32 90% 98% 92% 90%
fasta
source secs mem gz cpu cpu load
Ruby 63.32 98,996 1069 106.23 39% 28% 61% 42%
PHP 56.22 9,632 1062 56.20 2% 100% 0% 1%
n-body
source secs mem gz cpu cpu load
Ruby 387.73 16,196 1137 433.22 48% 4% 10% 51%
PHP 333.78 9,400 1082 333.70 44% 30% 1% 27%
pidigits
source secs mem gz cpu cpu load
Ruby 3.42 289,440 485 6.88 64% 38% 100% 4%
PHP 2.15 10,932 399 2.15 100% 2% 1% 0%
reverse-complement
source secs mem gz cpu cpu load
Ruby 23.09 1,604,952 295 40.79 59% 45% 35% 40%
PHP 12.54 513,344 438 7.51 59% 6% 61% 28%
fannkuch-redux
source secs mem gz cpu cpu load
Ruby 545.63 14,968 1454 2,111.38 94% 97% 97% 100%
PHP 227.59 35,536 1160 906.63 100% 99% 99% 100%
mandelbrot
source secs mem gz cpu cpu load
Ruby 452.81 59,660 954 1,805.81 100% 100% 100% 100%
PHP 118.28 139,504 875 472.05 100% 100% 100% 100%
k-nucleotide
source secs mem gz cpu cpu load
Ruby 189.81 137,920 667 714.29 94% 97% 96% 91%
PHP 41.29 250,628 1079 134.20 74% 78% 90% 90%
spectral-norm
source secs mem gz cpu cpu load
Ruby 237.96 18,312 326 280.55 97% 4% 6% 12%
PHP 38.56 20,848 1152 153.24 99% 100% 99% 99%
regex-redux
source secs mem gz cpu cpu load
Ruby 23.58 269,664 751 25.12 79% 68% 74% 85%
PHP 2.61 270,552 816 2.44 79% 40% 40% 42%
Ruby

ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
--jit

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