The Computer Language
Benchmarks Game

PHP versus Ruby fastest programs

by faster benchmark performance

regex-redux
source secs mem gz cpu cpu load
PHP 2.63 270,048 816 2.46 38% 39% 85% 38%
Ruby 14.10 268,288 751 19.01 66% 54% 91% 72%
mandelbrot
source secs mem gz cpu cpu load
PHP 118.07 137,452 875 471.57 100% 100% 100% 100%
Ruby 482.93 144,684 954 1,926.62 100% 100% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
PHP 37.09 20,208 1152 147.78 100% 100% 100% 100%
Ruby 132.22 54,944 862 494.13 94% 95% 93% 92%
reverse-complement
source secs mem gz cpu cpu load
PHP 12.08 516,904 438 7.57 3% 59% 29% 59%
Ruby 31.20 500,680 264 63.08 86% 59% 52% 7%
k-nucleotide
source secs mem gz cpu cpu load
PHP 41.39 242,044 1079 133.27 83% 76% 73% 91%
Ruby 104.85 383,724 880 386.32 96% 88% 99% 86%
fannkuch-redux
source secs mem gz cpu cpu load
PHP 233.57 34,748 1160 929.49 100% 99% 100% 99%
Ruby 581.68 36,872 1454 2,272.55 99% 94% 99% 99%
pidigits
source secs mem gz cpu cpu load
PHP 2.12 10,664 399 2.11 100% 0% 1% 1%
Ruby 3.29 277,496 485 6.58 8% 63% 32% 100%
n-body
source secs mem gz cpu cpu load
PHP 353.84 9,220 1082 353.77 0% 100% 1% 0%
Ruby 357.61 12,284 1137 401.68 8% 95% 5% 5%
fasta
source secs mem gz cpu cpu load
PHP 59.12 9,412 1062 59.11 40% 0% 1% 60%
Ruby 55.67 104,364 1069 96.83 53% 24% 78% 22%
binary-trees
source secs mem gz cpu cpu load
PHP 66.56 736,600 868 244.42 94% 92% 91% 96%
Ruby 52.41 434,004 1107 176.92 88% 85% 77% 89%
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

Ruby

ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-linux]