The Computer Language
Benchmarks Game

Python 3 programs versus Java

by benchmark task performance

pidigits
source secs KB gz cpu cpu load
Python 3 2.74 8,468 335 2.73 0% 1% 1% 100%
Java 4.14 25,988 938 4.13 1% 1% 0% 100%
regex-dna
source secs KB gz cpu cpu load
Python 3 25.11 249,088 478 24.98 1% 0% 1% 100%
Java 22.35 623,244 740 22.34 1% 1% 0% 100%
reverse-complement
source secs KB gz cpu cpu load
Python 3 5.54 262,360 800 5.53 1% 1% 1% 100%
Java 1.79 521,988 745 1.78 1% 2% 2% 100%
k-nucleotide
source secs KB gz cpu cpu load
Python 3 317.42 219,028 1937 317.16 0% 1% 1% 100%
Java 47.14 516,280 1602 47.10 1% 1% 1% 100%
fasta
source secs KB gz cpu cpu load
Python 3 122.25 6,508 977 122.19 1% 1% 1% 100%
Java 4.77 23,400 1507 4.76 1% 1% 1% 100%
binary-trees
source secs KB gz cpu cpu load
Python 3 497.80 482,656 596 497.40 1% 1% 1% 100%
Java 16.53 511,692 584 16.51 1% 1% 0% 100%
fannkuch-redux
source secs KB gz cpu cpu load
Python 3 2,464.08 44,564 944 2,463.20 1% 0% 0% 100%
Java 67.56 23,480 1282 67.53 1% 1% 1% 100%
n-body
source secs KB gz cpu cpu load
Python 3 1,024.87 6,324 1228 1,024.54 1% 0% 1% 100%
Java 24.07 23,184 1430 24.06 1% 1% 1% 100%
mandelbrot
source secs KB gz cpu cpu load
Python 3 1,209.01 40,500 686 1,208.52 1% 0% 1% 100%
Java 27.41 55,556 796 27.40 1% 0% 1% 100%
spectral-norm
source secs KB gz cpu cpu load
Python 3 1,105.41 7,120 328 1,105.02 1% 0% 0% 100%
Java 16.30 23,872 950 16.29 1% 0% 1% 100%
fasta-redux
source secs KB gz cpu cpu load
Python 3 455.18 395,312 1304 454.80 1% 1% 1% 100%
Java 1.89 23,120 1443 1.88 2% 2% 0% 100%
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_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) Server VM (build 25.92-b14, mixed mode)