The Computer Language
Benchmarks Game

PHP versus Python 3 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%
Python 3 15.56 439,964 512 27.97 25% 92% 32% 32%
spectral-norm
source secs mem gz cpu cpu load
PHP 37.09 20,208 1152 147.78 100% 100% 100% 100%
Python 3 193.86 50,556 443 757.23 98% 98% 99% 99%
n-body
source secs mem gz cpu cpu load
PHP 353.84 9,220 1082 353.77 0% 100% 1% 0%
Python 3 882.00 8,212 1196 881.81 91% 0% 1% 9%
mandelbrot
source secs mem gz cpu cpu load
PHP 118.07 137,452 875 471.57 100% 100% 100% 100%
Python 3 279.68 49,344 688 1,117.29 100% 100% 100% 100%
fannkuch-redux
source secs mem gz cpu cpu load
PHP 233.57 34,748 1160 929.49 100% 99% 100% 99%
Python 3 547.23 48,052 950 2,162.70 99% 100% 97% 100%
k-nucleotide
source secs mem gz cpu cpu load
PHP 41.39 242,044 1079 133.27 83% 76% 73% 91%
Python 3 79.79 250,948 1967 309.42 98% 96% 96% 99%
pidigits
source secs mem gz cpu cpu load
PHP 2.12 10,664 399 2.11 100% 0% 1% 1%
Python 3 3.51 10,500 386 3.50 1% 1% 0% 100%
binary-trees
source secs mem gz cpu cpu load
PHP 66.56 736,600 868 244.42 94% 92% 91% 96%
Python 3 92.72 448,844 589 333.42 87% 90% 96% 87%
reverse-complement
source secs mem gz cpu cpu load
PHP 12.08 516,904 438 7.57 3% 59% 29% 59%
Python 3 16.76 1,005,252 814 20.08 65% 21% 44% 17%
fasta
source secs mem gz cpu cpu load
PHP 59.12 9,412 1062 59.11 40% 0% 1% 60%
Python 3 62.88 680,736 1947 141.15 60% 56% 48% 62%
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

Python 3

Python 3.7.0