Skip to content

Instantly share code, notes, and snippets.

@axel22
Created July 11, 2013 18:54
Show Gist options
  • Save axel22/5978170 to your computer and use it in GitHub Desktop.
Save axel22/5978170 to your computer and use it in GitHub Desktop.
import org.scalameter.api._
object MyRangeTest extends PerformanceTest.Regression {
override def reporter: Reporter = Reporter.Composite(
new RegressionReporter(
RegressionReporter.Tester.Accepter(),
RegressionReporter.Historian.Complete()),
HtmlReporter(embedDsv = true)
)
def persistor = new SerializationPersistor()
val sizes = Gen.range("size")(1000000, 2000000, 500000)
val lists = for (sz <- sizes) yield (0 until sz).toList
performance of "List" in {
measure method "map" in {
using(lists) config (
exec.benchRuns -> 20,
exec.independentSamples -> 1
) in { xs =>
xs.map(_ + 1)
}
}
}
type SameType = this.type
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment