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.14 37,080 938 3.35 4% 4% 1% 98%
regex-redux
source secs mem gz cpu cpu load
Python 3 15.56 439,964 512 27.97 25% 92% 32% 32%
Java 10.43 609,920 929 31.73 72% 78% 72% 83%
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.18 672,272 2183 7.17 67% 46% 43% 77%
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 384,756 1812 26.91 69% 88% 81% 75%
binary-trees
source secs mem gz cpu cpu load
Python 3 93.40 449,328 589 336.54 88% 92% 94% 89%
Java 8.29 930,040 835 28.13 78% 94% 85% 86%
fasta
source secs mem gz cpu cpu load
Python 3 62.88 680,736 1947 141.15 60% 56% 48% 62%
Java 2.29 43,724 2473 6.16 67% 76% 59% 70%
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.74 31,900 1282 69.78 99% 98% 99% 98%
n-body
source secs mem gz cpu cpu load
Python 3 882.00 8,212 1196 881.81 91% 0% 1% 9%
Java 22.19 33,272 1489 22.28 35% 2% 66% 1%
spectral-norm
source secs mem gz cpu cpu load
Python 3 193.86 50,556 443 757.23 98% 98% 99% 99%
Java 4.41 35,028 950 16.79 96% 97% 98% 95%
mandelbrot
source secs mem gz cpu cpu load
Python 3 279.68 49,344 688 1,117.29 100% 100% 100% 100%
Java 6.13 76,876 796 23.60 96% 96% 96% 97%
Python 3

Python 3.7.0

Java

java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)