The Computer Language
Benchmarks Game

PHP programs versus Ruby

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
PHP 3.34 158,792 786 3.30 25% 26% 22% 92%
Ruby 28.80 309,760 424 28.77 15% 48% 20% 19%
spectral-norm
source secs mem gz cpu cpu load
PHP 37.94 19,420 1135 150.67 99% 99% 100% 99%
Ruby 141.49 50,156 835 544.76 96% 97% 96% 97%
mandelbrot
source secs mem gz cpu cpu load
PHP 125.17 136,776 863 499.16 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 280.04 33,588 1150 1,117.48 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.96 235,632 1060 142.28 87% 100% 71% 72%
Ruby 101.95 381,312 852 367.82 84% 98% 85% 95%
n-body
source secs mem gz cpu cpu load
PHP 358.21 8,668 1082 358.12 17% 0% 1% 83%
Ruby 723.69 8,916 1137 723.48 25% 86% 1% 9%
fasta
source secs mem gz cpu cpu load
PHP 59.37 8,896 1030 59.36 5% 2% 3% 100%
Ruby 108.36 107,984 973 108.32 7% 10% 75% 10%
pidigits
source secs mem gz cpu cpu load
PHP 2.15 9,884 394 2.15 1% 0% 100% 1%
Ruby 3.14 477,092 478 3.12 0% 100% 2% 1%
reverse-complement
source secs mem gz cpu cpu load
PHP 2.81 135,124 426 1.75 31% 21% 44% 57%
Ruby 4.03 505,656 509 7.14 51% 83% 37% 9%
binary-trees
source secs mem gz cpu cpu load
PHP 88.07 736,372 1027 247.49 92% 77% 23% 91%
Ruby 54.24 510,868 1078 153.99 73% 98% 67% 72%
PHP

PHP 7.1.4 (cli) (built: Apr 16 2017 16:17:54) ( 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]