vs

 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 OCaml program.

(Memory use is only compared for tasks that require memory to be allocated.)


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 OCaml program.

(Memory use is only compared for tasks that require memory to be allocated.)

 Scala used what fraction? used how many times more? 
Benchmark Time Memory Code
 k-nucleotide1/2±±
 mandelbrot1/2 ±
 binary-trees1/21/2
 fasta1/2 ±
 regex-dna±
 spectral-norm± ±
 pidigits †± 
 fannkuch-redux± ±
 n-body± ±
 reverse-complement17×1/2
 Scala used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/21/21/2±±

† 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 OCaml program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 k-nucleotide 
Scala25.109.23171,4642080  55% 76% 69% 73%
OCaml55.5020.29253,6241789  39% 57% 79% 100%
 mandelbrot 
Scala28.567.42285,580786  96% 96% 98% 96%
OCaml55.8814.046,548710  100% 100% 100% 100%
 binary-trees 
Scala24.4414.78397,928494  52% 24% 24% 68%
OCaml71.0025.55201,744784  80% 41% 90% 69%
 fasta 
Scala6.516.3726,9081053  2% 26% 1% 75%
OCaml10.5110.52198,0801161  0% 0% 1% 100%
 regex-dna 
Scala28.228.16422,9361704  96% 80% 87% 85%
OCaml1.468.96264,7441050  84% 95% 85% 85%
 spectral-norm 
Scala17.814.6325,420720  100% 95% 95% 95%
OCaml16.824.783,512938  93% 91% 92% 90%
 pidigits 
Scala3.742.9944,8361125  10% 9% 99% 10% †
OCaml2.812.819,036560  0% 0% 100% 0% †
 fannkuch-redux 
Scala69.8917.7725,6401017  97% 98% 100% 98%
OCaml0.0016.3011,2801004  100% 100% 100% 100%
 n-body 
Scala26.5226.4525,9041358  0% 1% 100% 0%
OCaml21.8621.877161239  100% 0% 0% 0%
 reverse-complement 
Scala2.021.54516,736761  3% 92% 5% 35%
OCaml0.000.7830,8401314  52% 29% 60% 78%
 fasta-redux 
Scala0.230.19?1435  5% 5% 16% 89%
No program

† 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 OCaml 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 OCaml 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.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

Scala compiler version 2.10.3 -- Copyright 2002-2013, 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/download/

Revised BSD license

  Home   Conclusions   License   Play