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 60.62 8,952 1062 60.61 0% 66% 35% 0%
binary-trees
source secs mem gz cpu cpu load
Python 3 93.55 280,624 589 337.74 92% 89% 87% 93%
PHP 91.40 736,224 1040 258.87 76% 88% 61% 59%
reverse-complement
source secs mem gz cpu cpu load
Python 3 3.26 264,596 814 4.67 18% 99% 1% 26%
PHP 2.80 135,312 438 1.68 80% 9% 59% 3%
mandelbrot
source secs mem gz cpu cpu load
Python 3 225.24 15,736 688 899.25 100% 100% 100% 100%
PHP 142.21 135,060 875 564.00 100% 100% 100% 100%
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,256 399 2.12 100% 0% 0% 1%
k-nucleotide
source secs mem gz cpu cpu load
Python 3 77.65 182,700 1967 302.86 97% 99% 97% 98%
PHP 43.83 235,524 1079 146.88 80% 89% 73% 95%
n-body
source secs mem gz cpu cpu load
Python 3 838.39 10,324 1196 838.20 95% 1% 5% 0%
PHP 387.92 8,708 1082 387.84 0% 34% 68% 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 244.56 33,692 1160 976.04 100% 100% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
Python 3 180.97 15,876 443 720.51 100% 100% 100% 100%
PHP 43.26 19,436 1152 172.15 100% 100% 100% 99%
regex-redux
source secs mem gz cpu cpu load
Python 3 15.22 447,324 512 27.44 25% 33% 32% 91%
PHP 3.32 158,820 816 3.25 78% 27% 18% 39%
Python 3

Python 3.6.3

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