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-trees10×±
 k-nucleotide12×1/21/3
 n-body41× ±
 spectral-norm46× 1/2
 fannkuch-redux52× 1/2
 mandelbrot67× ±
 fasta †76× 1/3
 Python 3 used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±27×52×76×76×

† 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.173.0323,504938  19% 80% 5% 3%
 regex-dna 
Python 322.9810.42269,120478  40% 48% 83% 55%
Java24.528.59707,744929  80% 64% 79% 64%
 reverse-complement 
Python 35.925.941,008,592325  1% 1% 1% 100% †
Java2.971.47300,7121661  47% 37% 78% 43% †
 binary-trees 
Python 3531.55140.741,123,020626  98% 94% 94% 94%
Java24.8914.48390,708584  34% 73% 38% 30%
 k-nucleotide 
Python 3374.51124.40498,756647  59% 58% 87% 98%
Java34.4410.221,096,5401844  79% 83% 82% 94%
 n-body 
Python 3939.20939.505,5641181  1% 0% 0% 100%
Java22.9022.8719,5721424  99% 1% 1% 1%
 spectral-norm 
Python 3821.48209.7643,728437  98% 98% 98% 98%
Java17.804.5921,132950  97% 96% 99% 96%
 fannkuch-redux 
Python 33,587.04915.3640,096797  98% 97% 100% 97%
Java70.0617.7319,7201282  99% 99% 98% 99%
 mandelbrot 
Python 31,760.17475.3710,556777  90% 100% 90% 90%
Java27.847.1162,344796  98% 97% 98% 100%
 fasta 
Python 3161.75166.415,576788  25% 27% 16% 34% †
Java5.782.2032,6202457  62% 75% 63% 65% †
 fasta-redux 
No program
Java0.210.17?1443  11% 6% 89% 17%

† 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