This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Benchcoat.scala | |
done: | |
2011-11-17 v.4: improvement in plot-code | |
x-axis and y-axis needs description (how many units measured, time in second) | |
2011-11-17 v.3: minor improvement in plot-code | |
2011-10-22 v.2: improvement in plot-code and renaming prettyPrint | |
extend Benchcoat by | |
providing a List of ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Question at http://stackoverflow.com/q/7084212/53013 | |
// Results at https://gist.github.com/1152764 | |
import scala.collection.mutable.{ArrayBuffer, ListBuffer} | |
import scala.util.Random | |
object BenchCode extends scala.testing.Benchmark with Algorithms { | |
var xs: List[Int] = Nil | |
var acc = 0 | |
var code: List[Int] => List[Int] = (identity _) |