/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 JavaScript V8 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 JavaScript V8 program.

 Scala used what fraction? used how many times more? 
Benchmark Time Memory Code
 k-nucleotide1/101/2
 reverse-complement1/6±
 fasta1/3±
 binary-trees1/2±±
 n-body1/2±
 spectral-norm±±
 fannkuch-redux±
 regex-dna
 Scala used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/101/101/41/2±

± 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 JavaScript V8 program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 k-nucleotide 
Scala29.9529.97216,7482080  0% 0% 0% 100%
JavaScript V8312.48312.99461,860451  1% 0% 0% 100%
 reverse-complement 
Scala2.142.17509,016761  0% 0% 0% 100%
JavaScript V812.7412.76392,364498  0% 0% 0% 100%
 fasta 
Scala6.546.5519,5881053  0% 1% 0% 100%
JavaScript V819.1619.187,672791  0% 0% 0% 100%
 binary-trees 
Scala16.7116.75507,072494  0% 0% 0% 100%
JavaScript V834.6534.70432,784467  0% 0% 0% 100%
 n-body 
Scala23.9123.9118,7561358  0% 0% 0% 100%
JavaScript V841.2841.305,9601527  0% 0% 0% 100%
 spectral-norm 
Scala16.5216.5318,484404  0% 1% 0% 100%
JavaScript V822.2822.297,496373  0% 0% 0% 100%
 fannkuch-redux 
Scala56.5656.5820,4721017  0% 1% 0% 100%
JavaScript V871.5771.605,508539  1% 0% 0% 100%
 regex-dna 
Scala35.2535.28776,552668  0% 0% 0% 100%
JavaScript V83.773.78354,480373  0% 1% 1% 100%
 fasta-redux 
Scala0.400.402401372  0% 0% 3% 100%
No program
 pidigits 
Scala0.690.7021,7441125  0% 1% 0% 99%
No program
 mandelbrot 
Scala0.420.4217,168786  0% 2% 2% 100%
JavaScript V8Bad Output

 4 : Are there other Scala programs for these benchmarks?

Remember - those are just the fastest Scala and JavaScript V8 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 JavaScript V8 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