The Computer Language
Benchmarks Game

Scala programs versus Java

by benchmark task performance

k-nucleotide
secs KB gz cpu cpu load
Scala 26.63 245,208 2080 26.61 0% 1% 1% 100%
Java 33.48 1,190,032 1844 33.44 1% 1% 0% 100%
fannkuch-redux
secs KB gz cpu cpu load
Scala 58.81 29,816 1017 58.78 2% 1% 1% 100%
Java 67.66 26,644 1282 67.63 1% 1% 0% 100%
n-body
secs KB gz cpu cpu load
Scala 23.45 28,980 1358 23.44 1% 0% 1% 100%
Java 24.33 24,036 1424 24.32 1% 0% 0% 100%
spectral-norm
secs KB gz cpu cpu load
Scala 16.01 28,252 404 16.00 0% 1% 1% 100%
Java 16.37 26,876 950 16.36 1% 1% 0% 100%
mandelbrot
secs KB gz cpu cpu load
Scala 27.24 105,996 786 27.22 0% 1% 0% 100%
Java 27.19 88,448 796 27.18 1% 0% 1% 100%
pidigits
secs KB gz cpu cpu load
Scala 4.44 53,504 1125 4.44 1% 2% 0% 100%
Java 4.14 26,616 938 4.14 2% 0% 1% 100%
reverse-complement
secs KB gz cpu cpu load
Scala 2.02 517,176 761 2.01 0% 1% 1% 100%
Java 1.80 522,620 745 1.80 3% 1% 1% 99%
regex-dna
secs KB gz cpu cpu load
Scala 24.06 509,328 723 24.04 1% 2% 2% 100%
Java 20.80 567,404 1284 20.79 0% 0% 1% 100%
fasta
secs KB gz cpu cpu load
Scala 6.44 29,880 1053 6.43 1% 1% 1% 100%
Java 4.81 24,836 1507 4.80 1% 1% 0% 100%
binary-trees
secs KB gz cpu cpu load
Scala 17.36 520,128 494 17.34 1% 1% 0% 100%
Java 10.70 518,220 926 10.68 1% 1% 0% 100%
fasta-redux
secs KB gz cpu cpu load
Scala 3.53 24,748 1435 3.52 1% 1% 0% 100%
Java 2.05 24,576 1443 2.04 1% 0% 0% 100%
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) 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) Server VM (build 25.45-b02, mixed mode)