The Computer Language
Benchmarks Game

Haskell GHC versus Java fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

regex-redux
source secs mem gz busy cpu load
Haskell GHC 1.78 307,992 2213 4.35 79% 50% 50% 65%
Java 10.13 644,456 929 31.05 73% 75% 91% 67%
fasta
source secs mem gz busy cpu load
Haskell GHC 1.40 7,992 1882 4.15 75% 74% 75% 74%
Java 2.23 43,292 2473 6.05 63% 48% 92% 68%
mandelbrot
source secs mem gz busy cpu load
Haskell GHC 4.87 36,328 1975 19.39 99% 100% 100% 99%
Java 5.93 76,272 796 23.28 97% 99% 98% 98%
n-body
source secs mem gz busy cpu load
Haskell GHC 21.87 4,364 1883 86.49 99% 100% 99% 98%
Java 22.67 34,892 1429 23.01 1% 0% 0% 100%
spectral-norm
source secs mem gz busy cpu load
Haskell GHC 4.10 4,012 987 15.83 97% 97% 99% 95%
Java 4.14 36,456 950 16.16 97% 99% 98% 97%
fannkuch-redux
source secs mem gz busy cpu load
Haskell GHC 18.37 4,352 842 72.54 96% 100% 100% 100%
Java 17.89 33,352 1282 70.90 98% 100% 100% 99%
pidigits
source secs mem gz busy cpu load
Haskell GHC 4.22 9,964 585 5.27 8% 100% 9% 9%
Java 3.07 38,408 938 3.39 0% 8% 99% 3%
binary-trees
source secs mem gz busy cpu load
Haskell GHC 12.96 476,448 592 47.98 92% 92% 93% 94%
Java 8.25 964,656 835 27.65 79% 96% 76% 84%
reverse-complement
source secs mem gz busy cpu load
Haskell GHC 6.42 501,528 1020 9.38 14% 100% 16% 16%
Java 3.14 730,620 2183 7.02 72% 45% 51% 55%
k-nucleotide
source secs mem gz busy cpu load
Haskell GHC 35.91 637,624 1486 125.59 86% 86% 86% 91%
Java 9.08 404,688 1812 29.03 77% 77% 93% 73%
Haskell GHC

The Glorious Glasgow Haskell Compilation System,
version 8.8.1

Java

openjdk 14 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)