The Computer Language
Benchmarks Game

Python 3 programs versus Java

by benchmark task performance

pidigits
secs KB gz cpu cpu load
Python 3 2.20 10,248 335 2.20 1% 0% 0% 100%
Java 3.12 33,528 938 3.22 3% 2% 80% 21%
regex-dna
secs KB gz cpu cpu load
Python 3 10.58 266,312 478 23.44 49% 39% 68% 68%
Java 8.24 761,724 929 24.70 68% 73% 77% 83%
reverse-complement
secs KB gz cpu cpu load
Python 3 3.11 266,972 800 4.56 20% 99% 2% 29%
Java 1.27 315,296 1661 2.68 41% 48% 34% 92%
k-nucleotide
secs KB gz cpu cpu load
Python 3 76.50 162,004 1937 297.12 97% 97% 97% 99%
Java 11.29 1,118,288 1844 38.66 83% 97% 82% 82%
binary-trees
secs KB gz cpu cpu load
Python 3 152.06 804,624 596 516.24 94% 92% 95% 91%
Java 6.20 524,828 926 20.90 87% 91% 82% 80%
fannkuch-redux
secs KB gz cpu cpu load
Python 3 567.35 55,368 944 2,220.71 98% 96% 100% 99%
Java 17.41 33,032 1282 68.64 98% 98% 99% 99%
n-body
secs KB gz cpu cpu load
Python 3 923.74 8,040 1181 923.49 44% 13% 0% 44%
Java 22.66 30,036 1424 22.68 97% 3% 0% 1%
mandelbrot
secs KB gz cpu cpu load
Python 3 293.92 55,392 686 1,171.64 100% 100% 100% 100%
Java 6.27 88,992 796 24.24 96% 97% 97% 98%
fasta
secs KB gz cpu cpu load
Python 3 111.44 8,276 977 111.40 28% 0% 0% 73%
Java 2.19 39,368 2457 5.60 58% 72% 66% 61%
spectral-norm
secs KB gz cpu cpu load
Python 3 250.12 58,892 437 932.41 94% 95% 92% 93%
Java 4.28 32,696 950 16.53 96% 96% 96% 99%
fasta-redux
secs KB gz cpu cpu load
  No program contribute your program
Java 0.19 ? 1443 0.22 95% 10% 10% 10%
Python 3

Python 3.5.0 (default, Sep 14 2015, 08:50:08) [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) 64-Bit Server VM (build 25.45-b02, mixed mode)