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/8±
 binary-trees±±
 fasta27× ±
 fannkuch-redux40× ±
 mandelbrot40× ±
 n-body41× ±
 spectral-norm59× 1/2
 Python 3 used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±18×40×59×59×

± 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.742.745,400335  0% 1% 100% 0%
Java4.154.0423,488938  2% 2% 0% 100%
 regex-dna 
Python 323.4910.58253,208478  47% 39% 94% 43%
Java26.349.02714,924929  64% 75% 86% 67%
 reverse-complement 
Python 35.453.72259,780800  30% 1% 72% 47%
Java2.671.36306,1561661  81% 33% 38% 47%
 k-nucleotide 
Python 3291.9475.78148,1921937  97% 97% 100% 97%
Java35.8910.661,200,3201844  82% 83% 92% 82%
 binary-trees 
Python 3470.42125.06470,428596  93% 97% 94% 94%
Java18.8013.20476,640584  38% 37% 32% 37%
 fasta 
Python 3127.5445.962,479,9041933  76% 65% 78% 80%
Java5.231.7329,1042457  70% 68% 95% 70%
 fannkuch-redux 
Python 32,582.98654.6128,068944  100% 99% 98% 98%
Java64.3816.3319,9081282  98% 100% 98% 99%
 mandelbrot 
Python 31,106.61277.2728,372686  100% 100% 100% 100%
Java27.036.9181,940796  98% 99% 97% 98%
 n-body 
Python 3993.47993.704,2401181  0% 0% 100% 1%
Java24.4724.4519,5081424  1% 1% 100% 0%
 spectral-norm 
Python 31,004.46252.9230,320437  99% 100% 99% 99%
Java16.564.3020,064950  95% 96% 99% 96%
 fasta-redux 
No program
Java0.200.18?1443  88% 25% 6% 16%

 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 5 2015, 10:03:09) [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