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.20 10,248 335 2.20 1% 0% 0% 100%
Java 3.11 33,364 938 3.20 99% 2% 2% 2%
regex-dna
source secs KB gz cpu cpu load
Python 3 10.58 266,312 478 23.44 49% 39% 68% 68%
Java 8.23 753,008 929 24.56 71% 78% 81% 70%
reverse-complement
source secs KB gz cpu cpu load
Python 3 3.11 266,972 800 4.56 20% 99% 2% 29%
Java 1.17 345,940 1661 2.42 41% 43% 57% 72%
k-nucleotide
source secs KB gz cpu cpu load
Python 3 76.50 162,004 1937 297.12 97% 97% 97% 99%
Java 12.87 462,488 1602 44.44 98% 81% 85% 82%
binary-trees
source secs KB gz cpu cpu load
Python 3 152.06 804,624 596 516.24 94% 92% 95% 91%
Java 11.51 622,328 889 40.10 86% 86% 92% 87%
n-body
source secs KB gz cpu cpu load
Python 3 923.74 8,040 1181 923.49 44% 13% 0% 44%
Java 22.53 28,212 1430 22.54 100% 7% 1% 1%
mandelbrot
source secs KB gz cpu cpu load
Python 3 293.92 55,392 686 1,171.64 100% 100% 100% 100%
Java 7.14 88,236 796 27.93 97% 98% 98% 99%
fannkuch-redux
source secs KB gz cpu cpu load
Python 3 567.35 55,368 944 2,220.71 98% 96% 100% 99%
Java 13.65 31,996 1282 53.64 99% 98% 99% 98%
fasta
source secs KB gz cpu cpu load
Python 3 111.44 8,276 977 111.40 28% 0% 0% 73%
Java 2.20 37,072 2457 6.37 81% 68% 72% 72%
spectral-norm
source secs KB gz cpu cpu load
Python 3 250.12 58,892 437 932.41 94% 95% 92% 93%
Java 4.26 32,244 950 16.41 96% 98% 95% 97%
fasta-redux
source secs KB gz cpu cpu load
  No program contribute your program
Java 0.17 ? 1443 0.19 17% 12% 78% 0%
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_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)