The Computer Language
Benchmarks Game

PHP programs versus Ruby

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
PHP 3.32 158,820 816 3.25 78% 27% 18% 39%
Ruby 28.80 309,760 424 28.77 15% 48% 20% 19%
spectral-norm
source secs mem gz cpu cpu load
PHP 43.26 19,436 1152 172.15 100% 100% 100% 99%
Ruby 141.49 50,156 835 544.76 96% 97% 96% 97%
mandelbrot
source secs mem gz cpu cpu load
PHP 142.21 135,060 875 564.00 100% 100% 100% 100%
Ruby 463.95 69,656 1019 1,852.06 100% 100% 100% 100%
fannkuch-redux
source secs mem gz cpu cpu load
PHP 244.56 33,692 1160 976.04 100% 100% 100% 100%
Ruby 710.58 33,348 1426 2,761.73 99% 99% 95% 97%
k-nucleotide
source secs mem gz cpu cpu load
PHP 43.83 235,524 1079 146.88 80% 89% 73% 95%
Ruby 101.95 381,312 852 367.82 84% 98% 85% 95%
n-body
source secs mem gz cpu cpu load
PHP 387.92 8,708 1082 387.84 0% 34% 68% 0%
Ruby 723.69 8,916 1137 723.48 25% 86% 1% 9%
fasta
source secs mem gz cpu cpu load
PHP 60.62 8,952 1062 60.61 0% 66% 35% 0%
Ruby 108.36 107,984 973 108.32 7% 10% 75% 10%
pidigits
source secs mem gz cpu cpu load
PHP 2.12 10,256 399 2.12 100% 0% 0% 1%
Ruby 3.14 477,092 478 3.12 0% 100% 2% 1%
reverse-complement
source secs mem gz cpu cpu load
PHP 2.80 135,312 438 1.68 80% 9% 59% 3%
Ruby 4.03 505,656 509 7.14 51% 83% 37% 9%
binary-trees
source secs mem gz cpu cpu load
PHP 91.40 736,224 1040 258.87 76% 88% 61% 59%
Ruby 54.24 510,868 1078 153.99 73% 98% 67% 72%
PHP

PHP 7.1.11 (cli) (built: Nov 16 2017 15:22:17) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

Ruby

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