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,848 987 15.70 97% 97% 99% 95%
Java 4.29 31,428 950 16.56 97% 96% 98% 97%
fannkuch-redux
source secs mem gz cpu cpu load
Haskell GHC 17.00 6,948 1153 66.65 95% 100% 98% 99%
Java 17.74 30,048 1282 69.90 98% 98% 100% 99%
n-body
source secs mem gz cpu cpu load
Haskell GHC 24.48 7,856 1874 25.55 2% 100% 1% 2%
Java 21.50 27,240 1489 21.52 1% 1% 100% 0%
reverse-complement
source secs mem gz cpu cpu load
Haskell GHC 1.43 131,184 999 1.59 6% 6% 99% 2%
Java 1.11 345,308 1661 2.44 33% 58% 54% 80%
binary-trees
source secs mem gz cpu cpu load
Haskell GHC 20.83 817,104 612 65.44 72% 92% 80% 72%
Java 11.52 643,924 889 40.54 89% 92% 85% 89%
mandelbrot
source secs mem gz cpu cpu load
Haskell GHC 11.63 44,252 782 46.34 100% 100% 100% 100%
Java 5.89 89,504 796 23.08 98% 98% 98% 99%
k-nucleotide
source secs mem gz cpu cpu load
Haskell GHC 41.92 602,836 1463 146.09 87% 95% 91% 89%
Java 8.02 467,004 1802 25.57 76% 98% 73% 74%
fasta
source secs mem gz cpu cpu load
Haskell GHC 15.50 450,024 1296 48.32 76% 76% 87% 77%
Java 2.14 36,192 2457 5.68 71% 58% 62% 77%
regex-redux
source secs mem gz cpu cpu load
Haskell GHC   Bad Output
Java 0.69 46,096 929 1.58 85% 67% 53% 53%
pidigits
source secs mem gz cpu cpu load
Haskell GHC   Make Error
Java 0.24 828 938 0.24 71% 38% 8% 4%
Haskell GHC

The Glorious Glasgow Haskell Compilation System, version 8.0.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)