The Computer Language
Benchmarks Game

Ruby programs versus PHP

by benchmark task performance

binary-trees
source secs mem gz cpu cpu load
Ruby 58.72 192,132 1123 166.36 67% 61% 68% 90%
PHP 103.82 ? 1161 ? 85% 88% 92% 75%
reverse-complement
source secs mem gz cpu cpu load
Ruby 4.03 505,656 509 7.14 51% 83% 37% 9%
PHP 2.91 134,048 426 1.79 67% 22% 61% 2%
pidigits
source secs mem gz cpu cpu load
Ruby 3.14 477,092 478 3.12 0% 100% 2% 1%
PHP 2.19 8,852 394 2.18 100% 1% 0% 2%
n-body
source secs mem gz cpu cpu load
Ruby 723.69 8,916 1137 723.48 25% 86% 1% 9%
PHP 432.48 7,928 1082 432.36 0% 100% 0% 1%
fasta
source secs mem gz cpu cpu load
Ruby 108.36 107,984 973 108.32 7% 10% 75% 10%
PHP 59.28 7,936 1030 59.26 1% 0% 1% 100%
fannkuch-redux
source secs mem gz cpu cpu load
Ruby 710.58 33,348 1426 2,761.73 99% 99% 95% 97%
PHP 321.58 29,140 1150 1,280.13 100% 100% 99% 100%
k-nucleotide
source secs mem gz cpu cpu load
Ruby 101.95 381,312 852 367.82 84% 98% 85% 95%
PHP 44.55 135,472 1060 152.16 81% 92% 76% 93%
spectral-norm
source secs mem gz cpu cpu load
Ruby 141.49 50,156 835 544.76 96% 97% 96% 97%
PHP 41.23 17,104 1135 163.58 99% 99% 100% 99%
mandelbrot
source secs mem gz cpu cpu load
Ruby 463.95 69,656 1019 1,852.06 100% 100% 100% 100%
PHP 134.34 132,880 863 536.04 100% 100% 100% 100%
regex-redux
source secs mem gz cpu cpu load
Ruby 28.80 309,760 424 28.77 15% 48% 20% 19%
PHP 3.37 155,708 786 3.24 20% 93% 24% 27%
Ruby

ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]

PHP

PHP 7.0.6 (cli) (built: May 4 2016 16:00:18) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies