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.57 443,932 653 28.15 33% 92% 26% 31%
spectral-norm
source secs mem gz cpu cpu load
PHP 37.09 20,208 1152 147.78 100% 100% 100% 100%
Python 3 187.94 50,612 605 739.82 98% 99% 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 875.23 8,300 1355 875.05 76% 24% 1% 0%
fannkuch-redux
source secs mem gz cpu cpu load
PHP 233.57 34,748 1160 929.49 100% 99% 100% 99%
Python 3 557.67 47,276 1080 2,205.81 100% 99% 100% 98%
mandelbrot
source secs mem gz cpu cpu load
PHP 118.07 137,452 875 471.57 100% 100% 100% 100%
Python 3 278.36 49,156 771 1,112.07 100% 100% 100% 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.61 241,140 2054 310.70 98% 97% 97% 100%
reverse-complement
source secs mem gz cpu cpu load
PHP 12.08 516,904 438 7.57 3% 59% 29% 59%
Python 3 21.71 1,005,340 898 20.37 28% 65% 26% 12%
pidigits
source secs mem gz cpu cpu load
PHP 2.12 10,664 399 2.11 100% 0% 1% 1%
Python 3 3.52 10,540 504 3.52 0% 1% 1% 100%
binary-trees
source secs mem gz cpu cpu load
PHP 65.20 736,468 868 235.57 93% 94% 92% 98%
Python 3 92.78 449,512 721 333.90 90% 93% 90% 90%
fasta
source secs mem gz cpu cpu load
PHP 59.12 9,412 1062 59.11 40% 0% 1% 60%
Python 3 61.81 674,580 2034 139.94 55% 66% 40% 68%
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