1 : Are the Python 3 programs faster? At a glance.

Each chart bar shows, for one unidentified benchmark, how much the fastest Python 3 program used compared to the fastest PHP 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 : Are the Python 3 programs faster? Approximately.

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

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

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

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

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

 3 : Are the Python 3 programs faster? Measurements.

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 Python 3 program are shown for comparison against measurements of the fastest PHP program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 binary-trees 
Python 3481.66127.90838,044596  98% 93% 93% 94% †
PHP604.84605.711,021,744472  38% 22% 42% 0% †
 reverse-complement 
Python 34.302.92262,444800  4% 19% 99% 29% †
PHP5.845.84444,344262  1% 0% 1% 100% †
 fasta 
Python 390.6190.645,608977  1% 1% 1% 100%
PHP116.02116.053,3681030  0% 1% 100% 0%
 mandelbrot 
Python 3954.62239.1040,852686  100% 100% 100% 100%
PHP1,216.19305.00115,240863  100% 100% 100% 100%
 fannkuch-redux 
Python 32,154.08546.3840,176944  98% 99% 98% 99%
PHP2,659.99667.4515,1881150  100% 100% 100% 100%
 pidigits 
Python 32.212.216,784335  1% 100% 1% 0%
PHP2.222.234,064394  1% 0% 1% 100%
 regex-dna 
Python 322.9810.42269,120478  40% 48% 83% 55%
PHP27.699.58150,456832  64% 60% 67% 100%
 n-body 
Python 3939.20939.505,5641181  1% 0% 0% 100%
PHP698.86699.073,3681082  62% 0% 38% 1%
 spectral-norm 
Python 3821.48209.7643,728437  98% 98% 98% 98%
PHP500.25126.5623,5161193  99% 99% 99% 99%
 k-nucleotide 
Python 3279.6375.48225,4121937  93% 91% 92% 96% †
PHP42.5737.50247,8561036  91% 4% 7% 13% †
 fasta-redux 
No program
PHP0.640.643,3721110  2% 0% 0% 98%

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

 4 : Are there other Python 3 programs for these benchmarks?

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

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

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Python 3 and PHP 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.

 Python 3 : the new Python 

Python 3.4.0 (default, Mar 17 2014, 08:05:26) [GCC 4.8.1] on linux

"3.x is the newest branch of Python and the intended future of the language."

"Van Rossum: Python is not too slow"

Home Page: Python 3.4.0 was released on March 16th, 2014.

Revised BSD license

  Home   Conclusions   License   Play