EzDevInfo.com

scalameter

Microbenchmarking and performance regression testing framework for the JVM platform. ScalaMeter | ScalaMeter

scalameter no "Gen.tupled" and "persistence"

I'm guessing there is just not up-to-date documentation in scalameter 0.7:

https://scalameter.github.io/home/gettingstarted/0.7/regressions/

I'm trying to go over the examples there. Just having hard time to make it work:

class CachedGeneratorTest
extends Bench.OnlineRegressionReport {
  def persistor = new persistence.SerializationPersistor
  ...
  val inputs = Gen.tupled(sizes, pools)
}

what I should use instead of persistence, and tupled there (since there are not such things anymore)?


Source: (StackOverflow)

sbt + Intellij IDEA: dependencies from git?

I am trying to manage my projects dependencies with sbt and I am having trouble with getting things from GitHub. I tried doing a kind of multi-project-dependency something or other, but that just broke what I already had. My end goal is being able to fetch things from GitHub along with sbt plug-ins and generate an Intellij IDEA project.

I've searched high and low, but maybe not high/low enough. Thanks for your help. I am new at this.

Here's a gist of my build.scala: https://gist.github.com/anonymous/c4178a90a7c7ccfe3856
And a gist of the output of "sbt update": https://gist.github.com/anonymous/0d10caeaf361a7399a7f


Source: (StackOverflow)

Advertisements

How to implement a generator for scalameter

I'm currently trying to benchmark an algorithm that pulls data from a database and performs operations on it, the function takes a little longer then I'd like and I would like to benchmark it so I can monitor any performance increase (as well as demonstrate it to clients). My issue is that the only 'documented' benchmarking library is scalameter and it doesn't really go into depth of how to use it. I'm quite lost in how to make a generator for a custom class called 'User' which generates random users as inputs. Secondly, I'm not quite sure how the benchmarking works with scalameter, what exactly is the Parameters type they use and how do you use it.

Am I even looking in the right direction?


Source: (StackOverflow)

Setting testFrameworks for a specific SBT configuration

I'm trying to integrate ScalaMeter into a separate configuration of our build. I want to run all performance tests in a separate configuration, since they are naturally slow. In Build.scala I have:

  lazy val ItTest = config("it").extend(Test)

  lazy val PerfTest = config("perf").extend(Test)

  val testSettings = Seq(
    testOptions in Test := Seq(Tests.Filter(x => !itFilter(x))),
    testOptions in ItTest := Seq(Tests.Filter(x => itFilter(x))),
    testFrameworks in PerfTest := Seq(new TestFramework("org.scalameter.ScalaMeterFramework")),
    logBuffered in PerfTest := false,
    // testOptions in PerfTest := Seq(Tests.Filter(perfFilter)),
    // needed thanks to http://stackoverflow.com/questions/7898273/how-to-get-logging-working-in-scala-unit-tests-with-testng-slf4s-and-logback
    parallelExecution in Test := false,
    parallelExecution in ItTest := false,
    parallelExecution in PerfTest := false)

 lazy val project1 = project.configs(ItTest, PerfTest).settings(testSettings: _*) // etc

testFrameworks are getting set as expected:

> show *:testFrameworks
[info] project1/*:testFrameworks
[info]  List(TestFramework(WrappedArray(org.scalacheck.ScalaCheckFramework)), TestFramework(WrappedArray(org.specs2.runner.Specs2Framework, org.specs2.runner.SpecsFramework)), TestFramework(WrappedArray(org.specs.runner.SpecsFramework)), TestFramework(WrappedArray(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework)), TestFramework(WrappedArray(com.novocode.junit.JUnitFramework)))
[info] project2/*:testFrameworks
[info]  List(TestFramework(WrappedArray(org.scalacheck.ScalaCheckFramework)), TestFramework(WrappedArray(org.specs2.runner.Specs2Framework, org.specs2.runner.SpecsFramework)), TestFramework(WrappedArray(org.specs.runner.SpecsFramework)), TestFramework(WrappedArray(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework)), TestFramework(WrappedArray(com.novocode.junit.JUnitFramework)))
[info] all/*:testFrameworks
[info]  List(TestFramework(WrappedArray(org.scalacheck.ScalaCheckFramework)), TestFramework(WrappedArray(org.specs2.runner.Specs2Framework, org.specs2.runner.SpecsFramework)), TestFramework(WrappedArray(org.specs.runner.SpecsFramework)), TestFramework(WrappedArray(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework)), TestFramework(WrappedArray(com.novocode.junit.JUnitFramework)))
> show perf:testFrameworks
[info] project1/perf:testFrameworks
[info]  List(TestFramework(WrappedArray(org.scalameter.ScalaMeterFramework)))
[info] project2/perf:testFrameworks
[info]  List(TestFramework(WrappedArray(org.scalameter.ScalaMeterFramework)))
[info] all/perf:testFrameworks
[info]  List(TestFramework(WrappedArray(org.scalameter.ScalaMeterFramework)))

Howewer, perf:test runs ScalaTest tests, and doesn't run ScalaMeter ones (instead of vice versa, as expected). How can I fix this problem?

This happens with SBT version 0.13.1 as well as 0.13.0.


Source: (StackOverflow)