The Computer Language
Benchmarks Game

Python 3 versus Java fastest programs

by faster benchmark performance

pidigits
source secs mem gz cpu cpu load
Python 3 3.51 10,500 386 3.50 1% 1% 0% 100%
Java 3.13 37,324 938 3.35 98% 5% 3% 3%
regex-redux
source secs mem gz cpu cpu load
Python 3 15.56 439,964 512 27.97 25% 92% 32% 32%
Java 10.52 637,380 929 31.89 75% 80% 77% 72%
reverse-complement
source secs mem gz cpu cpu load
Python 3 16.76 1,005,252 814 20.08 65% 21% 44% 17%
Java 3.31 626,956 2183 7.44 56% 60% 83% 45%
k-nucleotide
source secs mem gz cpu cpu load
Python 3 79.79 250,948 1967 309.42 98% 96% 96% 99%
Java 8.66 385,768 1812 26.52 76% 81% 74% 76%
binary-trees
source secs mem gz cpu cpu load
Python 3 92.72 448,844 589 333.42 87% 90% 96% 87%
Java 8.28 982,224 835 27.19 79% 86% 83% 83%
fasta
source secs mem gz cpu cpu load
Python 3 62.88 680,736 1947 141.15 60% 56% 48% 62%
Java 2.32 42,556 2473 6.24 73% 85% 49% 63%
fannkuch-redux
source secs mem gz cpu cpu load
Python 3 547.23 48,052 950 2,162.70 99% 100% 97% 100%
Java 17.91 31,560 1282 70.25 99% 98% 99% 97%
n-body
source secs mem gz cpu cpu load
Python 3 882.00 8,212 1196 881.81 91% 0% 1% 9%
Java 22.00 32,496 1489 22.07 1% 100% 0% 1%
mandelbrot
source secs mem gz cpu cpu load
Python 3 279.68 49,344 688 1,117.29 100% 100% 100% 100%
Java 6.96 76,748 796 27.07 98% 98% 96% 98%
spectral-norm
source secs mem gz cpu cpu load
Python 3 193.86 50,556 443 757.23 98% 98% 99% 99%
Java 4.27 32,960 950 16.41 95% 97% 98% 96%
Python 3

Python 3.7.0

Java

openjdk 11 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)