Ubuntu : Intel® Q6600® quad-core |
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.
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 | |
| pidigits | 1/12 | 1/2 | 1/2 | |
| binary-trees | 1/3 | 1/3 | 1/2 | |
| k-nucleotide | 1/2 | 2× | 1/2 | |
| fasta | 1/2 | 1/2 | ± | |
| spectral-norm | 1/2 | ± | 1/3 | |
| regex-dna | ± | ± | 1/3 | |
| mandelbrot | ± | 1/4 | 1/2 | |
| reverse-complement | ± | ± | ± | |
| n-body | ± | 1/2 | ± | |
| fannkuch | 2× | 1/9 | 1/2 | |
± read the measurements and then read the program source code.
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 CPython | 54.74 | 54.74 | 3,596 | 407 | 100% 0% 0% 0% |
| PHP | 679.79 | 679.75 | 7,808 | 736 | 60% 12% 28% 1% |
| binary-trees | |||||
| Python CPython | 980.23 | 279.06 | 674,024 | 626 | 86% 89% 85% 90% |
| PHP | 2,115.49 | 760.40 | 1,726,080 | 1089 | 90% 87% 90% 87% |
| k-nucleotide | |||||
| Python CPython | 277.72 | 84.94 | 441,680 | 519 | 54% 94% 82% 96% |
| PHP | 579.82 | 157.07 | 249,684 | 1268 | 96% 88% 96% 88% |
| fasta | |||||
| Python CPython | 208.55 | 208.54 | 2,928 | 779 | 61% 23% 4% 12% |
| PHP | 344.44 | 344.43 | 5,200 | 1030 | 56% 16% 20% 8% |
| spectral-norm | |||||
| Python CPython | 942.71 | 242.94 | 23,632 | 428 | 98% 97% 98% 95% |
| PHP | 1,365.45 | 365.83 | 22,876 | 1193 | 98% 93% 92% 91% |
| regex-dna | |||||
| Python CPython | 11.73 | 11.73 | 196,492 | 314 | 0% 0% 100% 0% |
| PHP | 50.61 | 17.50 | 219,596 | 1044 | 83% 63% 63% 80% |
| mandelbrot | |||||
| Python CPython | 2,882.02 | 720.54 | 23,468 | 425 | 100% 100% 100% 100% |
| PHP | 3,917.97 | 995.95 | 91,036 | 863 | 100% 98% 98% 98% |
| reverse-complement | |||||
| Python CPython | 6.78 | 6.78 | 561,860 | 288 | 0% 40% 61% 0% |
| PHP | 7.20 | 7.21 | 446,236 | 343 | 65% 0% 0% 34% |
| n-body | |||||
| Python CPython | 1,443.10 | 1,443.02 | 2,932 | 1105 | 86% 7% 1% 7% |
| PHP | 1,506.15 | 1,506.05 | 5,220 | 1255 | 90% 4% 1% 6% |
| fannkuch | |||||
| Python CPython | 3,232.09 | 3,231.90 | 2,852 | 387 | 36% 8% 48% 7% |
| PHP | 6,331.44 | 1,608.53 | 25,052 | 745 | 98% 99% 99% 99% |
| chameneos-redux | |||||
| Python CPython | 2.36 | 1.94 | 3,020 | 869 | 36% 24% 51% 15% |
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.
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 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/