The Computer Language
Benchmarks Game

Scala programs versus Java

by benchmark task performance

fannkuch-redux
secs KB gz cpu cpu load
Scala 15.23 36,820 1017 59.62 99% 98% 98% 97%
Java 17.41 33,032 1282 68.64 98% 98% 99% 99%
pidigits
secs KB gz cpu cpu load
Scala 2.97 61,272 1125 3.53 33% 3% 73% 11%
Java 3.12 33,528 938 3.22 3% 2% 80% 21%
regex-dna
secs KB gz cpu cpu load
Scala 7.98 466,024 1704 27.87 85% 84% 92% 88%
Java 8.24 761,724 929 24.70 68% 73% 77% 83%
binary-trees
secs KB gz cpu cpu load
Scala 11.52 686,532 641 36.29 85% 87% 72% 73%
Java 11.58 649,456 889 40.18 94% 85% 87% 83%
k-nucleotide
secs KB gz cpu cpu load
Scala 6.77 223,624 2080 20.28 92% 70% 70% 69%
Java 6.60 263,468 2568 20.56 76% 76% 90% 70%
spectral-norm
secs KB gz cpu cpu load
Scala 4.41 38,900 693 16.56 94% 93% 92% 97%
Java 4.28 32,696 950 16.53 96% 96% 96% 99%
n-body
secs KB gz cpu cpu load
Scala 23.67 35,236 1358 23.72 0% 100% 1% 0%
Java 22.66 30,036 1424 22.68 97% 3% 0% 1%
reverse-complement
secs KB gz cpu cpu load
Scala 1.36 477,268 761 1.80 39% 4% 90% 4%
Java 1.27 315,296 1661 2.68 41% 48% 34% 92%
mandelbrot
secs KB gz cpu cpu load
Scala 7.20 93,120 786 27.97 97% 100% 97% 96%
Java 6.27 88,992 796 24.24 96% 97% 97% 98%
fasta-redux
secs KB gz cpu cpu load
Scala 3.14 33,388 1435 3.21 2% 1% 20% 80%
Java 2.59 29,940 1443 2.65 1% 76% 1% 25%
fasta
secs KB gz cpu cpu load
Scala 7.35 36,560 1053 7.47 78% 23% 1% 2%
Java 2.19 39,368 2457 5.60 58% 72% 66% 61%
Scala

Scala compiler version 2.11.6 -- Copyright 2002-2013, LAMP/EPFL

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

Java

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)