|
Scala 2.4.0-RC2
|
abstract
trait
Benchmark
extends
java.lang.Object
with
scala.ScalaObject
Benchmark
can be used to quickly turn an existing
class into a benchmark. Here is a short example:
object sort1 extends Sorter with Benchmark { def run = sort(List.range(1, 1000)) }
The run method has to be defined by the user, who will perform the timed operation there. Run the benchmark as follows:
> scala sort1 5 times.log
This will run the benchmark 5 times and log the execution times in
a file called times.log
Var Summary | |
var
multiplier
: scala.Int
|
Def Summary | |
def
main
(args: scala.Array[java.lang.String])
: scala.Unit
The entry point. It takes two arguments: the number of consecutive runs, and the name of a log file where to append the times. |
|
abstract
|
def
run
: scala.Unit
this method should be implemented by the concrete benchmark |
def
runBenchmark
(noTimes: scala.Int)
: scala.List[scala.Long]
Run the benchmark the specified number of times and return a list with the execution times in milliseconds in reverse order of the execution |
Var Detail |
Def Detail |
def
main
(args: scala.Array[java.lang.String]): scala.Unit
abstract
def
run
: scala.Unit
def
runBenchmark
(noTimes: scala.Int): scala.List[scala.Long]
noTimes -
...