1 : At a glance - Are the PHP programs faster?

Each chart bar shows, for one unidentified benchmark, how much the fastest PHP program used compared to the fastest Python 3 program.

(Memory use is only compared for tasks that require memory to be allocated.)


These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.

 2 : Approximately - Are the PHP programs faster?

Each table row shows, for one named benchmark, how much the fastest PHP program used compared to the fastest Python 3 program.

(Memory use is only compared for tasks that require memory to be allocated.)

 PHP used what fraction? used how many times more? 
Benchmark Time Memory Code
 spectral-norm1/2 
 k-nucleotide †1/21/2
 n-body± ±
 regex-dna±1/2
 fannkuch-redux± ±
 mandelbrot± ±
 pidigits± ±
 reverse-complement †±1/3
 fasta † 1/2
 binary-trees †±±
 PHP used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/21/2±±

† possible mismatch - one-core program compared to multi-core program.

± read the measurements and then read the program source code.

 3 : Measurements - Are the PHP programs faster?

These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.

For each named benchmark, measurements of the fastest PHP program are shown for comparison against measurements of the fastest Python 3 program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 spectral-norm 
PHP436.74110.1814,1361193  99% 99% 100% 99%
Python 31,004.46252.9230,320437  99% 100% 99% 99%
 k-nucleotide 
PHP46.7441.46246,9721036  91% 13% 4% 6% †
Python 3291.9475.78148,1921937  97% 97% 100% 97% †
 n-body 
PHP674.38674.542,5921082  0% 1% 1% 100%
Python 3984.24984.536,0801228  6% 100% 2% 7%
 regex-dna 
PHP29.0210.00152,084832  64% 67% 65% 96%
Python 323.4910.58253,208478  47% 39% 94% 43%
 fannkuch-redux 
PHP2,506.27630.2810,5161150  100% 99% 99% 100%
Python 32,582.98654.6128,068944  100% 99% 98% 98%
 mandelbrot 
PHP1,119.48280.48107,708863  100% 100% 100% 100%
Python 31,106.61277.2728,372686  100% 100% 100% 100%
 pidigits 
PHP2.852.863,412394  1% 100% 0% 1%
Python 32.742.745,400335  0% 1% 100% 0%
 reverse-complement 
PHP7.037.04369,104297  1% 1% 0% 100% †
Python 35.453.72259,780800  30% 1% 72% 47% †
 fasta 
PHP118.72118.762,5921030  0% 100% 1% 1% †
Python 3127.5445.962,479,9041933  76% 65% 78% 80% †
 binary-trees 
PHP528.51529.00549,952472  34% 66% 1% 1% †
Python 3470.42125.06470,428596  93% 97% 94% 94% †
 fasta-redux 
PHP0.710.712,5961110  3% 0% 99% 4%
No program

† possible mismatch - one-core program compared to multi-core program.

 4 : Are there other PHP programs for these benchmarks?

Remember - those are just the fastest PHP and Python 3 programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for PHP.

Maybe one of those other PHP programs is fastest on a different OS/machine.

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest PHP and Python 3 programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.

Maybe one of those other programs is fastest on a different OS/machine.

 PHP : scripts embedded in html and much more 

PHP 5.6.7 (cli) (built: Mar 25 2015 15:21:21)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

Overall Performance: PHP is rarely the bottleneck (HTML slides)

Home Page: http://www.php.net/

Download: http://www.php.net/downloads.php

Revised BSD license

  Home   Conclusions   License   Play