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.58 656,192 929 17.84 83% 83% 80% 74%
mandelbrot
source secs mem gz busy cpu load
Haskell GHC 1.47 31,136 1975 5.83 99% 99% 99% 100%
Java 4.15 70,040 796 16.34 98% 98% 99% 98%
fasta
source secs mem gz busy cpu load
Haskell GHC 0.86 8,008 1882 2.80 83% 80% 81% 81%
Java 1.28 44,172 2473 4.17 83% 78% 88% 76%
spectral-norm
source secs mem gz busy cpu load
Haskell GHC 1.48 4,124 987 5.73 96% 97% 96% 98%
Java 1.66 38,280 950 6.36 97% 95% 96% 96%
pidigits
source secs mem gz busy cpu load
Haskell GHC 0.89 6,048 1694 0.90 0% 100% 1% 0%
Java 0.94 35,604 764 0.99 1% 4% 3% 97%
fannkuch-redux
source secs mem gz busy cpu load
Haskell GHC 10.22 4,148 1113 40.27 100% 99% 100% 95%
Java 9.94 34,188 1282 39.21 99% 98% 99% 97%
n-body
source secs mem gz busy cpu load
Haskell GHC 6.95 4,188 1883 26.84 95% 95% 100% 95%
Java 6.76 35,156 1489 6.83 1% 0% 100% 1%
binary-trees
source secs mem gz busy cpu load
Haskell GHC 4.34 471,032 799 15.56 96% 88% 87% 87%
Java 2.49 2,490,296 835 7.88 92% 75% 78% 72%
reverse-complement
source secs mem gz busy cpu load
Haskell GHC 2.92 501,644 1020 3.43 6% 100% 6% 6%
Java 1.53 720,672 2183 3.57 52% 63% 59% 59%
k-nucleotide
source secs mem gz busy cpu load
Haskell GHC 20.11 522,844 1059 74.17 94% 90% 95% 91%
Java 4.88 409,508 1812 15.86 75% 88% 86% 77%
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)