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-dna1/21/3
 reverse-complement †1/5
 binary-trees11×±
 k-nucleotide12×1/21/3
 n-body42× ±
 spectral-norm46× 1/2
 fannkuch-redux51× 1/2
 mandelbrot66× ±
 fasta †77× 1/3
 Python 3 used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±27×51×77×77×

† 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 32.402.416,600256  1% 2% 0% 100%
Java3.153.0329,084938  3% 4% 81% 21%
 regex-dna 
Python 322.9810.42269,120478  40% 48% 83% 55%
Java22.726.31648,9241410  89% 96% 88% 89%
 reverse-complement 
Python 35.925.941,008,592325  1% 1% 1% 100% †
Java2.731.25307,7401661  37% 90% 44% 50% †
 binary-trees 
Python 3531.55140.741,123,020626  98% 94% 94% 94%
Java18.8413.36511,792603  71% 21% 20% 31%
 k-nucleotide 
Python 3374.51124.40498,756647  59% 58% 87% 98%
Java36.6510.711,120,9601844  94% 82% 84% 83%
 n-body 
Python 3939.20939.505,5641181  1% 0% 0% 100%
Java22.6422.6225,2321424  1% 2% 1% 97%
 spectral-norm 
Python 3821.48209.7643,728437  98% 98% 98% 98%
Java17.604.5525,696950  96% 96% 97% 98%
 fannkuch-redux 
Python 33,587.04915.3640,096797  98% 97% 100% 97%
Java70.2517.8127,0481282  98% 99% 99% 99%
 mandelbrot 
Python 31,760.17475.3710,556777  90% 100% 90% 90%
Java28.057.1786,152796  98% 97% 98% 99%
 fasta 
Python 3161.75166.415,576788  25% 27% 16% 34% †
Java5.782.1633,6402457  84% 59% 61% 66% †
 fasta-redux 
No program
Java0.200.17?1443  25% 6% 6% 71%

† 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: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