÷

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

This chart shows 3 comparisons - Time-used, Memory-used and Code-used ~ speed and size.

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


 Step 2 : Are the Python CPython programs faster? Approximately.

This table shows 3 comparisons - Time-used, Memory-used and Code-used ~ speed and size.

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

 Python CPython used what fraction? used how many times more? 
Benchmark Time Memory Code
 pidigits1/121/21/2
 binary-trees1/31/31/2
 k-nucleotide1/21/2
 fasta1/21/2±
 spectral-norm1/2±1/3
 regex-dna±±1/3
 mandelbrot±1/41/2
 reverse-complement±±±
 n-body±1/2±
 fannkuch1/91/2

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

 Step 3 : Are the Python CPython programs faster? Measurements.

This table shows 5 measurements - CPU Time, Elapsed Time, Memory, Code and ≈ CPU Load ~ speed and size.

For each named benchmark, measurements of the fastest Python CPython 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
 pidigits 
Python CPython54.7454.743,596407  100% 0% 0% 0%
PHP679.79679.757,808736  60% 12% 28% 1%
 binary-trees 
Python CPython980.23279.06674,024626  86% 89% 85% 90%
PHP2,115.49760.401,726,0801089  90% 87% 90% 87%
 k-nucleotide 
Python CPython277.7284.94441,680519  54% 94% 82% 96%
PHP579.82157.07249,6841268  96% 88% 96% 88%
 fasta 
Python CPython208.55208.542,928779  61% 23% 4% 12%
PHP344.44344.435,2001030  56% 16% 20% 8%
 spectral-norm 
Python CPython942.71242.9423,632428  98% 97% 98% 95%
PHP1,365.45365.8322,8761193  98% 93% 92% 91%
 regex-dna 
Python CPython11.7311.73196,492314  0% 0% 100% 0%
PHP50.6117.50219,5961044  83% 63% 63% 80%
 mandelbrot 
Python CPython2,882.02720.5423,468425  100% 100% 100% 100%
PHP3,917.97995.9591,036863  100% 98% 98% 98%
 reverse-complement 
Python CPython6.786.78561,860288  0% 40% 61% 0%
PHP7.207.21446,236343  65% 0% 0% 34%
 n-body 
Python CPython1,443.101,443.022,9321105  86% 7% 1% 7%
PHP1,506.151,506.055,2201255  90% 4% 1% 6%
 fannkuch 
Python CPython3,232.093,231.902,852387  36% 8% 48% 7%
PHP6,331.441,608.5325,052745  98% 99% 99% 99%
 chameneos-redux 
Python CPython2.361.943,020869  36% 24% 51% 15%
No program

 Step 4 : Are there other Python CPython programs for these benchmarks?

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

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

 Step 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Python CPython 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 CPython : uncluttered imperative programming plus objects 

Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2

Online book: Dive Into Python

Home Page: http://www.python.org/

Download: http://www.python.org/download/

Revised BSD license

  Home   Flawed   Fastest   License   Help