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/21/3
 reverse-complement1/2
 k-nucleotide16×1/31/3
 binary-trees31×±±
 fannkuch-redux39× 1/3
 n-body41× ±
 fasta48× 1/3
 spectral-norm58× 1/3
 mandelbrot64× ±
 Python 3 used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±35×48×64×64×

± 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.043.055,312256  1% 0% 0% 100%
Java4.144.1421,844938  1% 0% 1% 100%
 regex-dna 
Python 323.9223.94247,788424  0% 1% 1% 100%
Java22.1222.13564,9521377  2% 1% 1% 100%
 reverse-complement 
Python 36.546.56781,140325  1% 0% 1% 100%
Java1.691.69519,612745  0% 1% 0% 100%
 k-nucleotide 
Python 3490.63492.77431,792647  0% 1% 1% 100%
Java31.1831.211,189,8121844  1% 1% 0% 100%
 binary-trees 
Python 3506.90507.35688,448626  1% 1% 1% 100%
Java16.4116.44521,176584  0% 1% 1% 100%
 fannkuch-redux 
Python 32,649.782,655.584,192385  0% 0% 0% 100%
Java67.4867.5021,4481282  1% 1% 0% 100%
 n-body 
Python 31,006.751,007.024,2521181  1% 0% 0% 100%
Java24.5024.5219,6361424  1% 0% 1% 100%
 fasta 
Python 3234.62237.784,316792  1% 1% 1% 100%
Java4.934.9327,6682457  0% 1% 0% 100%
 spectral-norm 
Python 3939.78940.065,004328  0% 1% 0% 100%
Java16.3116.3120,440950  1% 1% 0% 100%
 mandelbrot 
Python 31,735.671,736.3952,196777  1% 1% 1% 100%
Java26.9626.9859,240796  1% 0% 0% 100%
 fasta-redux 
No program
Java0.180.19?1443  0% 0% 0% 100%

 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