The Computer Language
Benchmarks Game

PHP versus Python 3 fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

spectral-norm
source secs mem gz busy cpu load
PHP 17.84 24,120 1152 71.08 100% 100% 100% 100%
Python 3 124.52 49,872 417 484.76 97% 97% 97% 97%
fannkuch-redux
source secs mem gz busy cpu load
PHP 129.48 22,468 1160 514.90 99% 99% 100% 99%
Python 3 366.43 47,608 950 1,448.16 100% 99% 100% 97%
n-body
source secs mem gz busy cpu load
PHP 221.47 7,836 1082 226.63 1% 100% 1% 1%
Python 3 545.25 8,160 1196 558.88 1% 1% 1% 100%
mandelbrot
source secs mem gz busy cpu load
PHP 73.71 123,856 875 294.40 100% 100% 100% 100%
Python 3 170.25 47,568 688 680.12 100% 100% 100% 100%
k-nucleotide
source secs mem gz busy cpu load
PHP 24.68 215,640 1079 88.67 93% 81% 96% 89%
Python 3 48.51 134,372 1967 185.66 94% 100% 94% 95%
binary-trees
source secs mem gz busy cpu load
PHP 26.46 1,584,436 751 96.67 89% 90% 100% 87%
Python 3 48.45 448,980 589 171.58 86% 86% 87% 94%
pidigits
source secs mem gz busy cpu load
PHP 0.99 9,116 399 1.01 1% 0% 1% 100%
Python 3 1.29 11,976 567 1.30 0% 100% 1% 0%
fasta
source secs mem gz busy cpu load
PHP 32.86 8,004 1062 33.02 0% 100% 0% 0%
Python 3 38.07 845,888 1947 75.85 23% 63% 66% 47%
reverse-complement
source secs mem gz busy cpu load
PHP 7.30 508,064 438 11.41 2% 30% 55% 69%
Python 3 7.15 1,005,204 814 10.62 81% 1% 47% 20%
regex-redux
source secs mem gz busy cpu load
PHP 1.71 271,952 816 3.50 37% 75% 43% 50%
Python 3 1.37 404,320 1403 2.65 32% 41% 33% 88%
PHP

PHP 7.4.7 (cli) (built: Jun 25 2020 16:42:51) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

Python 3

Python 3.8.3