Skip to content
Scala's benchmark suite library.
Scala
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
project
src/main/scala
.gitignore
AUTHOURS
README

README

Simple benchmark suite library for Scala programmers.

Getting started:

 import org.scalalites.benchmark.Benchmark

 Benchmark.run("Benchmark of ack:") { b =>
   def ack(x: Int, y: Int): Int = x match {
     case 0 => y + 1
     case _ => y match { case 0 => ack(x - 1, 1); case _ => ack(x - 1, ack(x, y - 1))}
   }
   // run over the test named "ack(3, 2) x 50" 50 times
   b.report("ack(3, 4) x 10", 10)  { ack(3, 4) }

   // If you don't pass second argument run benchmark once.
   b.report("ack(3, 2)")  { ack(3, 2) }
 }
 
 // Output
 // Benchmark of ack:
 //  ack(3, 4) x 10 : 4.730000 sec (avg. 0.473000 sec)
 //  ack(3, 2) x 1  : 0.029000 sec
You can’t perform that action at this time.