/mobile Handheld Friendly website
x64 Ubuntu : Intel® Q6600® quad-core |
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.
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 | |
| k-nucleotide | 1/2 | 1/2 | ± | |
| pidigits † | ± | ± | 1/2 | |
| spectral-norm | ± | ± | ± | |
| n-body | ± | ± | ± | |
| mandelbrot | ± | 3× | ± | |
| fannkuch-redux | ± | ± | ± | |
| reverse-complement | ± | ± | 1/2 | |
| fasta | ± | ± | ± | |
| binary-trees | ± | ± | 1/2 | |
| regex-dna | 2× | ± | ± | |
| fasta-redux | 2× | 2× | ± | |
| Scala used what fraction? used how many times more? | |||||||
|---|---|---|---|---|---|---|---|
| Time-used | |- | |--- | 25% | median | 75% | ---| | -| |
| (Elapsed secs) | 1/2 | 1/2 | ± | ± | ± | 2× | 2× |
† possible mismatch - one-core program compared to multi-core program.
± read the measurements and then read the program source code.
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 |
|---|---|---|---|---|---|
| k-nucleotide | |||||
| Scala | 23.86 | 8.31 | 215,304 | 2080 | 56% 79% 75% 77% |
| Java 7 | 46.39 | 13.25 | 450,972 | 1630 | 86% 84% 96% 85% |
| pidigits | |||||
| Scala | 3.56 | 2.98 | 52,776 | 1125 | 23% 11% 79% 7% † |
| Java 7 | 10.20 | 4.29 | 60,520 | 1808 | 68% 62% 65% 45% † |
| spectral-norm | |||||
| Scala | 17.75 | 4.63 | 23,308 | 720 | 95% 95% 95% 99% |
| Java 7 | 17.61 | 4.51 | 17,540 | 950 | 97% 97% 99% 98% |
| n-body | |||||
| Scala | 23.52 | 23.47 | 23,708 | 1358 | 1% 2% 1% 100% |
| Java 7 | 22.51 | 22.50 | 17,256 | 1424 | 0% 0% 100% 0% |
| mandelbrot | |||||
| Scala | 28.57 | 7.43 | 233,828 | 786 | 96% 96% 96% 98% |
| Java 7 | 27.82 | 7.07 | 69,460 | 796 | 99% 98% 99% 98% |
| fannkuch-redux | |||||
| Scala | 55.35 | 14.13 | 25,604 | 1017 | 98% 97% 99% 98% |
| Java 7 | 51.90 | 13.15 | 17,348 | 1282 | 99% 99% 98% 98% |
| reverse-complement | |||||
| Scala | 1.97 | 1.52 | 439,420 | 761 | 4% 3% 92% 35% |
| Java 7 | 2.79 | 1.31 | 298,404 | 1661 | 61% 77% 40% 39% |
| fasta | |||||
| Scala | 6.40 | 6.29 | 24,720 | 1053 | 0% 1% 1% 100% |
| Java 7 | 5.21 | 5.14 | 18,284 | 1507 | 0% 1% 1% 100% |
| binary-trees | |||||
| Scala | 16.37 | 12.46 | 477,616 | 494 | 12% 12% 11% 99% |
| Java 7 | 22.31 | 9.24 | 523,784 | 1007 | 37% 65% 58% 83% |
| regex-dna | |||||
| Scala | 34.01 | 15.48 | 980,808 | 668 | 39% 77% 61% 43% |
| Java 7 | 24.82 | 8.55 | 709,672 | 929 | 65% 82% 65% 79% |
| fasta-redux | |||||
| Scala | 5.00 | 4.70 | 33,916 | 1372 | 5% 1% 100% 2% |
| Java 7 | 2.56 | 2.52 | 17,308 | 1443 | 0% 1% 1% 100% |
† possible mismatch - one-core program compared to multi-core program.
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.
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.
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit 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/