/mobile Handheld Friendly website

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-trees11×±±
 k-nucleotide12×1/31/3
 n-body40× ±
 fasta49× 1/2
 fannkuch-redux59× 1/2
 spectral-norm60× 1/2
 mandelbrot70× ±
 Python 3 used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±26×59×70×70×

† 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 33.053.065,332256  1% 1% 0% 100%
Java4.154.0418,352938  16% 84% 1% 1%
 regex-dna 
Python 323.8111.01248,260478  37% 72% 45% 64%
Java26.449.20713,236929  80% 66% 77% 65%
 reverse-complement 
Python 36.536.55781,144325  0% 1% 0% 100% †
Java3.161.63296,1361661  77% 24% 39% 58% †
 binary-trees 
Python 3526.56139.26688,512626  93% 96% 96% 94%
Java17.7512.78471,136584  77% 15% 15% 34%
 k-nucleotide 
Python 3488.50161.33364,488647  89% 60% 98% 56%
Java45.3313.06923,0681630  81% 83% 85% 99%
 n-body 
Python 3984.27984.534,2521181  0% 100% 0% 0%
Java24.5024.4815,6561424  0% 100% 1% 0%
 fasta 
Python 3241.56246.324,324788  30% 24% 15% 33%
Java5.135.0516,4441507  2% 1% 1% 100%
 fannkuch-redux 
Python 34,000.061,012.0627,840797  99% 99% 98% 100%
Java68.0417.2515,6961282  99% 99% 97% 99%
 spectral-norm 
Python 31,026.66258.4230,260437  99% 99% 99% 99%
Java16.564.2916,460950  96% 96% 99% 96%
 mandelbrot 
Python 31,837.41483.667,488777  100% 94% 93% 94%
Java27.176.9573,488796  97% 97% 99% 98%
 fasta-redux 
No program
Java0.210.18?1443  6% 0% 17% 94%

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