The Computer Language
Benchmarks Game

Scala programs versus Java

by benchmark task performance

k-nucleotide
secs KB gz cpu cpu load
Scala 9.65 247,476 2080 28.77 67% 80% 63% 89%
Java 10.61 1,199,184 1844 35.27 79% 78% 90% 88%
regex-dna
secs KB gz cpu cpu load
Scala 8.25 451,912 1704 28.07 92% 84% 83% 83%
Java 8.80 729,244 929 25.79 77% 80% 72% 66%
pidigits
secs KB gz cpu cpu load
Scala 3.90 53,092 1125 4.51 29% 7% 53% 29%
Java 4.07 26,324 938 4.17 3% 3% 4% 96%
n-body
secs KB gz cpu cpu load
Scala 23.40 28,832 1358 23.45 1% 1% 100% 1%
Java 24.31 24,156 1424 24.34 1% 1% 1% 100%
fannkuch-redux
secs KB gz cpu cpu load
Scala 16.86 31,812 1017 66.07 98% 98% 99% 97%
Java 17.13 25,804 1282 67.56 100% 98% 99% 98%
mandelbrot
secs KB gz cpu cpu load
Scala 7.15 92,200 786 27.68 96% 96% 99% 97%
Java 7.12 87,832 796 27.79 97% 99% 97% 97%
spectral-norm
secs KB gz cpu cpu load
Scala 4.40 34,436 693 16.40 92% 93% 97% 92%
Java 4.30 26,476 950 16.53 99% 96% 95% 96%
reverse-complement
secs KB gz cpu cpu load
Scala 1.52 520,732 761 1.98 46% 2% 36% 49%
Java 1.44 308,060 1661 2.91 47% 31% 85% 43%
fasta-redux
secs KB gz cpu cpu load
Scala 3.41 24,656 1435 3.50 82% 3% 20% 2%
Java 1.93 24,588 1443 1.99 98% 2% 4% 3%
binary-trees
secs KB gz cpu cpu load
Scala 11.70 711,060 641 36.82 81% 83% 77% 77%
Java 5.88 513,180 926 19.64 95% 79% 87% 76%
fasta
secs KB gz cpu cpu load
Scala 6.26 29,488 1053 6.39 2% 89% 11% 1%
Java 1.82 31,600 2457 5.90 80% 83% 80% 82%
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)