The Computer Language
Benchmarks Game

Haskell GHC programs versus Java

by benchmark task performance

n-body
source secs mem gz cpu cpu load
Haskell GHC 21.45 9,988 1874 84.61 99% 99% 98% 100%
Java 22.56 35,208 1424 22.65 99% 1% 1% 1%
spectral-norm
source secs mem gz cpu cpu load
Haskell GHC 4.05 7,800 987 15.70 100% 94% 97% 97%
Java 4.25 36,364 950 16.30 97% 96% 95% 97%
fannkuch-redux
source secs mem gz cpu cpu load
Haskell GHC 15.50 7,972 1110 60.67 96% 100% 98% 99%
Java 15.09 34,764 1282 59.26 99% 98% 98% 100%
reverse-complement
source secs mem gz cpu cpu load
Haskell GHC 1.29 133,992 999 1.36 5% 100% 4% 5%
Java 1.13 199,672 2124 2.76 48% 74% 70% 54%
mandelbrot
source secs mem gz cpu cpu load
Haskell GHC 11.95 42,008 782 47.64 100% 100% 100% 100%
Java 6.08 77,056 796 23.61 97% 97% 99% 97%
binary-trees
source secs mem gz cpu cpu load
Haskell GHC 25.26 673,076 494 52.88 43% 93% 38% 38%
Java 8.58 966,808 835 28.98 86% 84% 90% 81%
k-nucleotide
source secs mem gz cpu cpu load
Haskell GHC 32.33 643,572 1463 124.08 97% 95% 95% 98%
Java 8.38 375,988 1802 26.25 73% 97% 70% 74%
fasta
source secs mem gz cpu cpu load
Haskell GHC 13.70 473,972 1296 45.44 98% 80% 79% 78%
Java 2.32 46,816 2457 6.37 61% 60% 96% 60%
pidigits
source secs mem gz cpu cpu load
Haskell GHC   Make Error
Java 0.30 856 938 0.37 45% 7% 17% 71%
regex-redux
source secs mem gz cpu cpu load
Haskell GHC   Bad Output
Java 0.56 37,036 929 1.45 67% 52% 93% 58%
Haskell GHC

The Glorious Glasgow Haskell Compilation System, version 8.2.1

Java

java 9
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)