The Computer Language
Benchmarks Game

Haskell GHC programs versus Java

by benchmark task performance

spectral-norm
source secs mem gz cpu cpu load
Haskell GHC 4.05 7,800 987 15.70 100% 94% 97% 97%
Java 4.29 29,884 950 16.56 96% 97% 99% 95%
n-body
source secs mem gz cpu cpu load
Haskell GHC 21.45 9,988 1874 84.61 99% 99% 98% 100%
Java 21.54 27,092 1489 21.56 1% 1% 100% 1%
fannkuch-redux
source secs mem gz cpu cpu load
Haskell GHC 15.50 7,972 1110 60.67 96% 100% 98% 99%
Java 13.74 30,368 1282 54.12 100% 98% 98% 99%
reverse-complement
source secs mem gz cpu cpu load
Haskell GHC 1.29 133,992 999 1.36 5% 100% 4% 5%
Java 1.10 345,352 1661 2.40 33% 82% 53% 54%
mandelbrot
source secs mem gz cpu cpu load
Haskell GHC 11.95 42,008 782 47.64 100% 100% 100% 100%
Java 7.10 90,588 796 27.92 99% 99% 98% 98%
binary-trees
source secs mem gz cpu cpu load
Haskell GHC 25.26 673,076 494 52.88 43% 93% 38% 38%
Java 11.26 593,156 835 39.02 85% 88% 90% 88%
k-nucleotide
source secs mem gz cpu cpu load
Haskell GHC 32.33 643,572 1463 124.08 97% 95% 95% 98%
Java 7.93 465,372 1802 25.11 75% 75% 75% 93%
fasta
source secs mem gz cpu cpu load
Haskell GHC 13.70 473,972 1296 45.44 98% 80% 79% 78%
Java 2.13 36,036 2457 5.66 94% 58% 59% 60%
regex-redux
source secs mem gz cpu cpu load
Haskell GHC   Bad Output
Java 0.56 39,104 929 1.57 72% 71% 75% 71%
pidigits
source secs mem gz cpu cpu load
Haskell GHC   Make Error
Java 0.23 784 938 0.24 48% 57% 9% 9%
Haskell GHC

The Glorious Glasgow Haskell Compilation System, version 8.2.1

Java

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)