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 0.97 308,072 2213 2.32 46% 51% 80% 62%
Java 5.75 647,984 929 18.61 82% 88% 77% 77%
mandelbrot
source secs mem gz busy cpu load
Haskell GHC 1.47 31,136 1975 5.83 99% 99% 99% 100%
Java 4.14 71,012 796 16.29 99% 99% 98% 98%
fasta
source secs mem gz busy cpu load
Haskell GHC 0.86 8,008 1882 2.80 83% 80% 81% 81%
Java 1.27 45,584 2473 3.91 82% 83% 73% 70%
pidigits
source secs mem gz busy cpu load
Haskell GHC 0.89 6,048 1694 0.90 0% 100% 1% 0%
Java 0.94 36,644 764 1.07 98% 5% 2% 9%
spectral-norm
source secs mem gz busy cpu load
Haskell GHC 1.48 4,124 987 5.73 96% 97% 96% 98%
Java 1.57 39,376 756 5.94 96% 94% 95% 95%
fannkuch-redux
source secs mem gz busy cpu load
Haskell GHC 10.22 4,148 1113 40.27 100% 99% 100% 95%
Java 10.61 34,960 1282 42.06 99% 99% 99% 98%
n-body
source secs mem gz busy cpu load
Haskell GHC 6.95 4,188 1883 26.84 95% 95% 100% 95%
Java 6.74 36,480 1489 6.84 100% 1% 0% 0%
binary-trees
source secs mem gz busy cpu load
Haskell GHC 4.34 522,348 811 16.37 94% 97% 94% 93%
Java 2.48 2,496,112 835 7.88 78% 91% 74% 75%
reverse-complement
source secs mem gz busy cpu load
Haskell GHC 2.92 501,644 1020 3.43 6% 100% 6% 6%
Java 1.58 677,584 2183 3.76 55% 74% 48% 61%
k-nucleotide
source secs mem gz busy cpu load
Haskell GHC 20.11 522,844 1059 74.17 94% 90% 95% 91%
Java 4.57 485,000 1812 14.50 77% 74% 83% 82%
Haskell GHC

The Glorious Glasgow Haskell Compilation System,
version 8.10.1

Java

java 14.0.1 2020-04-14
Java(TM) SE Runtime Environment (build 14.0.1+7)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)