Skip to content

Instantly share code, notes, and snippets.

View Stefan-Wagner's full-sized avatar

user unknown Stefan-Wagner

View GitHub Profile
/**
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 (
@dcsobral
dcsobral / BenchCode.scala
Created August 17, 2011 21:00
Benchmark code for algorithms in this Stack Overflow question regarding Java vs Scala performance: http://stackoverflow.com/q/7084212/53013
// 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 _)