The Computer Language
Benchmarks Game

Python 3 programs versus Java

by benchmark task performance

pidigits
secs KB gz cpu cpu load
Python 3 2.74 8,432 335 2.74 100% 1% 1% 1%
Java 4.07 26,324 938 4.17 3% 3% 4% 96%
regex-dna
secs KB gz cpu cpu load
Python 3 11.15 252,032 478 24.90 48% 40% 47% 89%
Java 8.80 729,244 929 25.79 77% 80% 72% 66%
reverse-complement
secs KB gz cpu cpu load
Python 3 3.92 262,588 800 5.69 24% 6% 45% 73%
Java 1.44 308,060 1661 2.91 47% 31% 85% 43%
k-nucleotide
secs KB gz cpu cpu load
Python 3 83.25 163,092 1937 320.96 98% 96% 96% 97%
Java 10.61 1,199,184 1844 35.27 79% 78% 90% 88%
binary-trees
secs KB gz cpu cpu load
Python 3 136.58 478,168 596 510.34 93% 96% 96% 93%
Java 5.88 513,180 926 19.64 95% 79% 87% 76%
fasta
secs KB gz cpu cpu load
Python 3 56.91 2,483,536 1933 149.79 62% 77% 52% 78%
Java 1.82 31,600 2457 5.90 80% 83% 80% 82%
fannkuch-redux
secs KB gz cpu cpu load
Python 3 638.70 44,820 944 2,512.66 96% 99% 99% 100%
Java 17.13 25,804 1282 67.56 100% 98% 99% 98%
n-body
secs KB gz cpu cpu load
Python 3 1,005.92 6,444 1228 1,005.65 100% 1% 0% 1%
Java 24.31 24,156 1424 24.34 1% 1% 1% 100%
mandelbrot
secs KB gz cpu cpu load
Python 3 306.32 41,240 686 1,222.44 100% 100% 100% 100%
Java 7.12 87,832 796 27.79 97% 99% 97% 97%
spectral-norm
secs KB gz cpu cpu load
Python 3 282.36 47,144 437 1,119.57 99% 99% 99% 99%
Java 4.30 26,476 950 16.53 99% 96% 95% 96%
fasta-redux
secs KB gz cpu cpu load
  No program contribute your program
Java 0.20 ? 1443 0.22 0% 10% 90% 11%
Python 3

Python 3.5.0 (default, Sep 14 2015, 09:36:50) [GCC 4.9.2] on linux

Java

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) Server VM (build 25.45-b02, mixed mode)