vs

 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 Java 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 Java 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
 pidigits± 1/4
 regex-dna±1/31/2
 reverse-complement †1/5
 binary-trees11×±±
 k-nucleotide15×1/31/3
 n-body40× ±
 spectral-norm60× 1/2
 fannkuch-redux62× 1/2
 mandelbrot70× ±
 fasta †142× 1/3
 Python 3 used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±28×62×142×142×

† 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 Java program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 pidigits 
Python 33.053.065,332256  1% 1% 0% 100%
Java4.154.0423,488938  2% 2% 0% 100%
 regex-dna 
Python 323.8111.01248,260478  37% 72% 45% 64%
Java26.349.02714,924929  64% 75% 86% 67%
 reverse-complement 
Python 36.536.55781,144325  0% 1% 0% 100% †
Java2.671.36306,1561661  81% 33% 38% 47% †
 binary-trees 
Python 3526.56139.26688,512626  93% 96% 96% 94%
Java18.8013.20476,640584  38% 37% 32% 37%
 k-nucleotide 
Python 3488.50161.33364,488647  89% 60% 98% 56%
Java35.8910.661,200,3201844  82% 83% 92% 82%
 n-body 
Python 3984.27984.534,2521181  0% 100% 0% 0%
Java24.4724.4519,5081424  1% 1% 100% 0%
 spectral-norm 
Python 31,026.66258.4230,260437  99% 99% 99% 99%
Java16.564.3020,064950  95% 96% 99% 96%
 fannkuch-redux 
Python 34,000.061,012.0627,840797  99% 99% 98% 100%
Java64.3816.3319,9081282  98% 100% 98% 99%
 mandelbrot 
Python 31,837.41483.667,488777  100% 94% 93% 94%
Java27.036.9181,940796  98% 99% 97% 98%
 fasta 
Python 3241.56246.324,324788  30% 24% 15% 33% †
Java5.231.7329,1042457  70% 68% 95% 70% †
 fasta-redux 
No program
Java0.200.18?1443  88% 25% 6% 16%

† 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 Java 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 Java 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:23:52) [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