The Computer Language
Benchmarks Game

Ruby programs versus PHP

by benchmark task performance

binary-trees
source secs mem gz cpu cpu load
Ruby 47.66 511,724 1083 137.38 66% 90% 70% 63%
PHP 79.01 736,908 1040 222.04 91% 95% 0% 95%
reverse-complement
source secs mem gz cpu cpu load
Ruby 3.73 571,404 517 7.00 49% 34% 96% 10%
PHP 2.79 136,636 438 1.63 30% 35% 32% 57%
pidigits
source secs mem gz cpu cpu load
Ruby 2.97 306,652 485 2.96 1% 0% 3% 100%
PHP 2.12 10,664 399 2.11 100% 0% 1% 1%
fasta
source secs mem gz cpu cpu load
Ruby 99.67 106,544 1002 99.65 0% 0% 100% 0%
PHP 59.12 9,412 1062 59.11 40% 0% 1% 60%
n-body
source secs mem gz cpu cpu load
Ruby 641.41 8,848 1137 641.26 8% 93% 0% 0%
PHP 353.84 9,220 1082 353.77 0% 100% 1% 0%
k-nucleotide
source secs mem gz cpu cpu load
Ruby 95.27 381,212 858 342.07 97% 86% 86% 91%
PHP 41.39 242,044 1079 133.27 83% 76% 73% 91%
fannkuch-redux
source secs mem gz cpu cpu load
Ruby 671.17 30,416 1432 2,613.66 98% 100% 100% 92%
PHP 233.57 34,748 1160 929.49 100% 99% 100% 99%
spectral-norm
source secs mem gz cpu cpu load
Ruby 119.33 49,312 835 461.61 97% 97% 97% 97%
PHP 37.09 20,208 1152 147.78 100% 100% 100% 100%
mandelbrot
source secs mem gz cpu cpu load
Ruby 520.83 127,152 925 2,081.07 100% 100% 100% 100%
PHP 118.07 137,452 875 471.57 100% 100% 100% 100%
regex-redux
source secs mem gz cpu cpu load
Ruby 25.64 311,964 431 25.63 6% 4% 60% 31%
PHP 2.63 270,048 816 2.46 38% 39% 85% 38%
Ruby

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

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