1 : At a glance - Are the Python 3 programs faster?

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 : Approximately - Are the Python 3 programs faster?

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/3
 regex-dna±1/31/2
 reverse-complement±1/2
 k-nucleotide1/5±
 binary-trees20×1/2
 fannkuch-redux29× ±
 mandelbrot38× ±
 n-body39× ±
 fasta †44× 1/3
 spectral-norm50× 1/2
 Python 3 used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±25×39×50×50×

† possible mismatch - one-core program compared to multi-core program.

± read the measurements and then read the program source code.

 3 : Measurements - Are the Python 3 programs faster?

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.212.216,744335  1% 100% 0% 1%
Java3.223.1233,528938  3% 2% 80% 21%
 regex-dna 
Python 322.8910.29259,568478  71% 38% 39% 75%
Java24.708.24761,724929  68% 73% 77% 83%
 reverse-complement 
Python 34.402.95262,292800  21% 81% 2% 48%
Java2.681.27315,2961661  41% 48% 34% 92%
 k-nucleotide 
Python 3272.6073.07226,1441937  92% 93% 94% 97%
Java38.6611.291,118,2881844  83% 97% 82% 82%
 binary-trees 
Python 3488.80129.60835,824596  93% 94% 98% 93%
Java21.116.48522,972926  81% 86% 89% 73%
 fannkuch-redux 
Python 31,981.89505.4239,992944  99% 97% 100% 97%
Java68.6417.4133,0321282  98% 98% 99% 99%
 mandelbrot 
Python 3956.49239.6042,456686  100% 100% 100% 100%
Java24.246.2788,992796  96% 97% 97% 98%
 n-body 
Python 3876.05876.277,8481228  0% 1% 100% 1%
Java22.6822.6630,0361424  97% 3% 0% 1%
 fasta 
Python 396.3096.335,628977  1% 100% 0% 0% †
Java5.602.1939,3682457  58% 72% 66% 61% †
 spectral-norm 
Python 3837.25211.8543,784437  99% 99% 99% 99%
Java16.534.2832,696950  96% 96% 96% 99%
 fasta-redux 
No program
Java0.220.19?1443  95% 10% 10% 10%

† 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.3 (default, Apr 4 2015, 09:21:43) [GCC 4.8.2] 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.3 was released Wednesday, February 25th, 2015.

Revised BSD license

  Home   Conclusions   License   Play