The Computer Language
Benchmarks Game

Scala programs versus Java

by benchmark task performance

fannkuch-redux
source secs KB gz cpu cpu load
Scala 58.81 29,816 1017 58.78 2% 1% 1% 100%
Java 67.02 23,380 1257 67.00 0% 1% 1% 100%
n-body
source secs KB gz cpu cpu load
Scala 23.45 28,980 1358 23.44 1% 0% 1% 100%
Java 24.07 23,184 1430 24.06 1% 1% 1% 100%
spectral-norm
source secs KB gz cpu cpu load
Scala 16.01 28,252 404 16.00 0% 1% 1% 100%
Java 16.30 23,872 950 16.29 1% 0% 1% 100%
mandelbrot
source secs KB gz cpu cpu load
Scala 27.24 105,996 786 27.22 0% 1% 0% 100%
Java 27.41 55,556 796 27.40 1% 0% 1% 100%
binary-trees
source secs KB gz cpu cpu load
Scala 17.36 520,128 494 17.34 1% 1% 0% 100%
Java 16.53 511,692 584 16.51 1% 1% 0% 100%
reverse-complement
source secs KB gz cpu cpu load
Scala 2.02 517,176 761 2.01 0% 1% 1% 100%
Java 1.79 521,988 745 1.78 1% 2% 2% 100%
fasta
source secs KB gz cpu cpu load
Scala 6.44 29,880 1053 6.43 1% 1% 1% 100%
Java 4.77 23,400 1507 4.76 1% 1% 1% 100%
regex-dna
source secs KB gz cpu cpu load
Scala 24.06 509,328 723 24.04 1% 2% 2% 100%
Java 11.41 699,176 1085 11.39 1% 1% 0% 100%
k-nucleotide
source secs KB gz cpu cpu load
Scala 93.00 491,624 1380 92.89 0% 1% 1% 100%
Java 36.57 512,948 1802 36.54 1% 0% 0% 100%
pidigits
source secs KB gz cpu cpu load
Scala   Failed
Java 0.34 492 938 0.32 3% 3% 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_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) Server VM (build 25.92-b14, mixed mode)