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.06 9,880 987 15.71 97% 97% 98% 97%
Java 4.29 29,884 950 16.56 96% 97% 99% 95%
n-body
source secs mem gz cpu cpu load
Haskell GHC 24.48 6,468 1874 25.62 85% 2% 2% 17%
Java 21.54 27,092 1489 21.56 1% 1% 100% 1%
fannkuch-redux
source secs mem gz cpu cpu load
Haskell GHC 16.70 7,628 1153 65.63 100% 95% 100% 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.39 132,176 999 1.52 4% 4% 100% 4%
Java 1.10 345,352 1661 2.40 33% 82% 53% 54%
mandelbrot
source secs mem gz cpu cpu load
Haskell GHC 11.64 41,180 782 46.40 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 26.28 511,444 494 52.69 35% 41% 93% 34%
Java 11.26 593,156 835 39.02 85% 88% 90% 88%
fasta
source secs mem gz cpu cpu load
Haskell GHC 14.68 455,088 1296 51.59 89% 87% 88% 91%
Java 2.13 36,036 2457 5.66 94% 58% 59% 60%
regex-redux
source secs mem gz cpu cpu load
Haskell GHC   Make Error
Java 0.56 39,104 929 1.57 72% 71% 75% 71%
k-nucleotide
source secs mem gz cpu cpu load
Haskell GHC   Make Error
Java 0.59 43,424 1802 1.21 49% 56% 53% 68%
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.0.2

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)