The Computer Language
Benchmarks Game

PHP programs versus Ruby

by benchmark task performance

pidigits
source secs mem gz cpu cpu load
PHP 2.19 8,852 394 2.18 100% 1% 0% 2%
Ruby 29.69 163,316 518 29.63 1% 100% 1% 1%
regex-dna
source secs mem gz cpu cpu load
PHP 2.23 106,284 832 5.09 62% 78% 49% 42%
Ruby 7.98 108,480 529 23.28 95% 69% 64% 64%
mandelbrot
source secs mem gz cpu cpu load
PHP 134.34 132,880 863 536.04 100% 100% 100% 100%
Ruby 463.95 69,656 1019 1,852.06 100% 100% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
PHP 41.23 17,104 1135 163.58 99% 99% 100% 99%
Ruby 141.49 50,156 835 544.76 96% 97% 96% 97%
k-nucleotide
source secs mem gz cpu cpu load
PHP 44.55 135,472 1060 152.16 81% 92% 76% 93%
Ruby 101.95 381,312 852 367.82 84% 98% 85% 95%
fannkuch-redux
source secs mem gz cpu cpu load
PHP 321.58 29,140 1150 1,280.13 100% 100% 99% 100%
Ruby 710.58 33,348 1426 2,761.73 99% 99% 95% 97%
fasta
source secs mem gz cpu cpu load
PHP 59.28 7,936 1030 59.26 1% 0% 1% 100%
Ruby 108.36 107,984 973 108.32 7% 10% 75% 10%
n-body
source secs mem gz cpu cpu load
PHP 432.48 7,928 1082 432.36 0% 100% 0% 1%
Ruby 723.69 8,916 1137 723.48 25% 86% 1% 9%
reverse-complement
source secs mem gz cpu cpu load
PHP 4.02 336,164 297 4.01 2% 0% 100% 0%
Ruby 4.03 505,656 509 7.14 51% 83% 37% 9%
binary-trees
source secs mem gz cpu cpu load
PHP 103.82 ? 1161 ? 85% 88% 92% 75%
Ruby 58.72 192,132 1123 166.36 67% 61% 68% 90%
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

Ruby

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