/mobile Handheld Friendly website

÷

 1 : Are the Scala programs faster? At a glance.

Each chart bar shows, for one unidentified benchmark, how much the fastest Scala program used compared to the fastest Java 7 program.


These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.

 2 : Are the Scala programs faster? Approximately.

Each table row shows, for one named benchmark, how much the fastest Scala program used compared to the fastest Java 7 program.

 Scala used what fraction? used how many times more? 
Benchmark Time Memory Code
 pidigits †±±1/2
 k-nucleotide±1/2±
 n-body±±±
 fannkuch-redux±±±
 spectral-norm±±±
 mandelbrot±±
 reverse-complement±1/2
 fasta±±±
 binary-trees±1/2
 regex-dna±±
 fasta-redux±
 Scala used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±±±±

† possible mismatch - one-core program compared to multi-core program.

± read the measurements and then read the program source code.

 3 : Are the Scala programs faster? Measurements.

These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.

For each named benchmark, measurements of the fastest Scala program are shown for comparison against measurements of the fastest Java 7 program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 pidigits 
Scala4.503.9042,8321125  7% 9% 93% 9% †
Java 711.755.1246,4881826  70% 67% 56% 39% †
 k-nucleotide 
Scala27.5110.18217,3082080  70% 74% 51% 76%
Java 744.8312.93494,2641602  84% 81% 85% 99%
 n-body 
Scala23.9723.9118,7761358  0% 1% 100% 0%
Java 724.4124.3913,9761424  0% 0% 0% 100%
 fannkuch-redux 
Scala70.9218.1020,4521017  98% 98% 98% 99%
Java 767.9117.1714,4601282  98% 99% 100% 100%
 spectral-norm 
Scala17.044.4718,772720  94% 94% 94% 99%
Java 716.394.2114,740950  97% 97% 98% 99%
 mandelbrot 
Scala28.227.39221,728786  95% 95% 99% 95%
Java 727.146.9067,612796  98% 98% 99% 99%
 reverse-complement 
Scala2.191.70489,548761  3% 4% 95% 31%
Java 72.931.52294,7841661  32% 59% 58% 47%
 fasta 
Scala6.636.4522,1361053  2% 0% 100% 1%
Java 75.074.9914,9761507  2% 0% 100% 1%
 binary-trees 
Scala18.9314.12462,460494  13% 28% 82% 13%
Java 721.359.21525,4201007  50% 70% 48% 65%
 regex-dna 
Scala37.8616.74862,976668  81% 42% 44% 60%
Java 727.099.43708,060929  65% 83% 78% 63%
 fasta-redux 
Scala4.474.1422,8121372  1% 0% 100% 7%
Java 71.901.8514,5001443  1% 2% 3% 100%

† possible mismatch - one-core program compared to multi-core program.

 4 : Are there other Scala programs for these benchmarks?

Remember - those are just the fastest Scala and Java 7 programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Scala.

Maybe one of those other Scala programs is fastest on a different OS/machine.

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Scala and Java 7 programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.

Maybe one of those other programs is fastest on a different OS/machine.

 Scala : higher-order type-safe programming for jvm 

java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) Server VM (build 23.6-b04, mixed mode)

Scala compiler version 2.10.0 -- Copyright 2002-2012, LAMP/EPFL

Online book: Programming in Scala pdf

A Scala Tutorial for Java programmers pdf

Home Page: http://scala.epfl.ch/

Download: http://scala.epfl.ch/downloads/index.html

Revised BSD license

  Home   Conclusions   License   Play