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,028 2213 2.31 64% 46% 81% 47%
Java 5.70 656,328 929 18.25 89% 76% 79% 75%
mandelbrot
source secs mem gz busy cpu load
Haskell GHC 1.47 38,268 1975 5.82 99% 100% 99% 99%
Java 4.11 68,204 796 16.20 98% 99% 98% 99%
fasta
source secs mem gz busy cpu load
Haskell GHC 0.88 7,948 1882 2.87 81% 82% 81% 81%
Java 1.20 44,124 2543 3.61 79% 86% 69% 65%
spectral-norm
source secs mem gz busy cpu load
Haskell GHC 1.48 4,044 987 5.71 96% 96% 97% 96%
Java 1.68 38,348 950 6.43 96% 96% 96% 95%
fannkuch-redux
source secs mem gz busy cpu load
Haskell GHC 10.22 3,620 1113 40.23 100% 100% 95% 99%
Java 11.00 34,104 1282 43.42 99% 98% 98% 99%
pidigits
source secs mem gz busy cpu load
Haskell GHC 0.75 5,992 1694 0.76 0% 0% 1% 100%
Java 0.79 35,568 764 0.84 99% 3% 3% 1%
n-body
source secs mem gz busy cpu load
Haskell GHC 6.95 4,196 1883 26.83 95% 95% 95% 100%
Java 6.75 35,200 1489 6.83 0% 0% 100% 1%
binary-trees
source secs mem gz busy cpu load
Haskell GHC 4.11 519,284 811 15.16 92% 89% 91% 97%
Java 2.50 2,487,096 835 7.90 88% 75% 75% 79%
reverse-complement
source secs mem gz busy cpu load
Haskell GHC 2.95 501,572 1020 3.51 6% 6% 6% 100%
Java 1.54 702,332 2183 3.55 78% 46% 49% 57%
k-nucleotide
source secs mem gz busy cpu load
Haskell GHC 20.01 522,656 1059 73.95 90% 91% 95% 94%
Java 5.00 408,040 1812 16.36 74% 81% 86% 86%
Haskell GHC

The Glorious Glasgow Haskell Compilation System,
version 8.10.1

Java

openjdk 15 2020-09-15
OpenJDK Runtime Environment (build 15+36-1562)
OpenJDK 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)