The Computer Language
Benchmarks Game

Python 3 programs versus PHP

by benchmark task performance

fasta
source secs mem gz cpu cpu load
Python 3 59.47 15,996 1947 138.97 55% 55% 63% 66%
PHP 59.12 9,412 1062 59.11 40% 0% 1% 60%
reverse-complement
source secs mem gz cpu cpu load
Python 3 3.26 264,596 814 4.67 18% 99% 1% 26%
PHP 2.79 136,636 438 1.63 30% 35% 32% 57%
binary-trees
source secs mem gz cpu cpu load
Python 3 93.55 280,624 589 337.74 92% 89% 87% 93%
PHP 79.01 736,908 1040 222.04 91% 95% 0% 95%
pidigits
source secs mem gz cpu cpu load
Python 3 3.43 12,716 386 3.43 100% 1% 1% 0%
PHP 2.12 10,664 399 2.11 100% 0% 1% 1%
k-nucleotide
source secs mem gz cpu cpu load
Python 3 77.65 182,700 1967 302.86 97% 99% 97% 98%
PHP 41.39 242,044 1079 133.27 83% 76% 73% 91%
mandelbrot
source secs mem gz cpu cpu load
Python 3 225.24 15,736 688 899.25 100% 100% 100% 100%
PHP 118.07 137,452 875 471.57 100% 100% 100% 100%
n-body
source secs mem gz cpu cpu load
Python 3 838.39 10,324 1196 838.20 95% 1% 5% 0%
PHP 353.84 9,220 1082 353.77 0% 100% 1% 0%
fannkuch-redux
source secs mem gz cpu cpu load
Python 3 565.97 15,528 950 2,172.63 95% 94% 95% 100%
PHP 233.57 34,748 1160 929.49 100% 99% 100% 99%
spectral-norm
source secs mem gz cpu cpu load
Python 3 180.97 15,876 443 720.51 100% 100% 100% 100%
PHP 37.09 20,208 1152 147.78 100% 100% 100% 100%
regex-redux
source secs mem gz cpu cpu load
Python 3 15.22 447,324 512 27.44 25% 33% 32% 91%
PHP 2.63 270,048 816 2.46 38% 39% 85% 38%
Python 3

Python 3.6.3

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