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.63 270,048 816 2.46 38% 39% 85% 38%
Ruby 13.14 314,092 751 7.85 90% 41% 41% 47%
mandelbrot
source secs mem gz cpu cpu load
PHP 118.07 137,452 875 471.57 100% 100% 100% 100%
Ruby 518.75 145,668 925 2,069.59 100% 100% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
PHP 37.09 20,208 1152 147.78 100% 100% 100% 100%
Ruby 125.65 52,368 835 484.43 96% 97% 97% 96%
fannkuch-redux
source secs mem gz cpu cpu load
PHP 233.57 34,748 1160 929.49 100% 99% 100% 99%
Ruby 650.83 33,224 1432 2,526.31 99% 99% 94% 98%
reverse-complement
source secs mem gz cpu cpu load
PHP 12.08 516,904 438 7.57 3% 59% 29% 59%
Ruby 32.71 497,404 264 32.69 100% 1% 1% 0%
k-nucleotide
source secs mem gz cpu cpu load
PHP 41.39 242,044 1079 133.27 83% 76% 73% 91%
Ruby 95.75 381,692 858 334.94 80% 82% 97% 95%
n-body
source secs mem gz cpu cpu load
PHP 353.84 9,220 1082 353.77 0% 100% 1% 0%
Ruby 641.41 8,848 1137 641.26 8% 93% 0% 0%
pidigits
source secs mem gz cpu cpu load
PHP 2.12 10,664 399 2.11 100% 0% 1% 1%
Ruby 2.97 306,652 485 2.96 1% 0% 3% 100%
fasta
source secs mem gz cpu cpu load
PHP 59.12 9,412 1062 59.11 40% 0% 1% 60%
Ruby 74.75 107,448 1069 74.60 1% 6% 100% 2%
binary-trees
source secs mem gz cpu cpu load
PHP 65.20 736,468 868 235.57 93% 94% 92% 98%
Ruby 50.97 367,192 1083 140.99 65% 62% 92% 59%
PHP

PHP 7.2.0 (cli) (built: Nov 30 2017 10:13:12) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies

Ruby

ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]