The Computer Language
Benchmarks Game

PHP programs versus Python 3

by benchmark task performance

spectral-norm
source secs mem gz cpu cpu load
PHP 37.94 19,420 1135 150.67 99% 99% 100% 99%
Python 3 188.83 54,524 437 750.46 99% 100% 100% 99%
regex-redux
source secs mem gz cpu cpu load
PHP 3.34 158,792 786 3.30 25% 26% 22% 92%
Python 3 14.86 439,208 486 27.92 46% 77% 35% 31%
n-body
source secs mem gz cpu cpu load
PHP 358.21 8,668 1082 358.12 17% 0% 1% 83%
Python 3 787.02 7,744 1181 786.82 0% 1% 0% 100%
mandelbrot
source secs mem gz cpu cpu load
PHP 125.17 136,776 863 499.16 100% 100% 100% 100%
Python 3 273.43 53,416 686 1,091.35 100% 100% 100% 100%
k-nucleotide
source secs mem gz cpu cpu load
PHP 43.96 235,632 1060 142.28 87% 100% 71% 72%
Python 3 84.73 221,028 1937 276.97 97% 93% 91% 91%
fasta
source secs mem gz cpu cpu load
PHP 59.37 8,896 1030 59.36 5% 2% 3% 100%
Python 3 110.91 8,024 977 110.87 100% 1% 1% 1%
fannkuch-redux
source secs mem gz cpu cpu load
PHP 280.04 33,588 1150 1,117.48 100% 100% 100% 100%
Python 3 483.79 51,896 944 1,880.10 97% 94% 100% 99%
reverse-complement
source secs mem gz cpu cpu load
PHP 2.81 135,124 426 1.75 31% 21% 44% 57%
Python 3 2.82 265,428 800 4.18 46% 32% 20% 54%
binary-trees
source secs mem gz cpu cpu load
PHP 88.07 736,372 1027 247.49 92% 77% 23% 91%
Python 3 86.90 451,548 581 306.31 89% 97% 87% 89%
pidigits
source secs mem gz cpu cpu load
PHP 0.12 ? 394 0.11 100% 7% 0% 0%
Python 3   Failed
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

Python 3

Python 3.6.1 (default, Apr 18 2017, 10:33:41)
[GCC 6.3.0 20170406]
--enable-optimizations --with-lto
make profile-opt