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 Perl 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 Perl 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
 mandelbrot1/3 ±
 k-nucleotide †1/21/4
 pidigits1/2 
 n-body1/2 ±
 fasta-redux± ±
 regex-dna±±
 fasta± ±
 fannkuch-redux± 
 reverse-complement±±
 binary-trees †1/2±
 spectral-norm 
 PHP used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/31/31/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 Perl program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 mandelbrot 
PHP1,216.19305.00115,240863  100% 100% 100% 100%
Perl3,071.86769.0043,400579  100% 100% 100% 100%
 k-nucleotide 
PHP42.5737.50247,8561036  91% 4% 7% 13% †
Perl221.4368.001,067,916472  69% 68% 97% 92% †
 pidigits 
PHP2.222.234,064394  1% 0% 1% 100%
Perl3.483.484,392261  1% 0% 100% 1%
 n-body 
PHP698.86699.073,3681082  62% 0% 38% 1%
Perl1,080.051,080.343,4521401  1% 0% 100% 1%
 fasta-redux 
PHP62.0762.093,3721110  1% 0% 100% 1%
Perl77.1777.193,456854  1% 0% 0% 100%
 regex-dna 
PHP27.699.58150,456832  64% 60% 67% 100%
Perl27.169.70142,492527  76% 75% 77% 54%
 fasta 
PHP116.02116.053,3681030  0% 1% 100% 0%
Perl105.80105.8352,320838  1% 1% 0% 100%
 fannkuch-redux 
PHP2,659.99667.4515,1881150  100% 100% 100% 100%
Perl2,297.64577.7010,976565  100% 99% 100% 99%
 reverse-complement 
PHP5.845.84444,344262  1% 0% 1% 100%
Perl2.742.74375,760284  1% 0% 0% 100%
 binary-trees 
PHP604.84605.711,021,744472  38% 22% 42% 0% †
Perl804.23238.081,706,872706  94% 72% 96% 77% †
 spectral-norm 
PHP500.25126.5623,5161193  99% 99% 99% 99%
Perl190.7749.439,540551  96% 96% 99% 96%

† 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 Perl 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 Perl 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:05:06)
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