scalameter / scalameter

Microbenchmarking and performance regression testing framework for the JVM platform.
http://scalameter.github.io
Other
507 stars 72 forks source link

Empty HTML Report #157

Open anthonylau opened 8 years ago

anthonylau commented 8 years ago

Not sure what was wrong. Would anyone advise?

object TestBenchmark extends Bench.LocalTime {
   val sizes = Gen.range("size")(100, 1000, 500)

  val ranges = for {
    size <- sizes
  } yield 0 until size

  override def warmer = Warmer.Zero

  override def reporter = new HtmlReporter()

  performance of "Range" in {
    measure method "map" in {
      using(ranges) in {
        r => r.map(_ + 1)
      }
    }
  }
}

screen shot 2016-01-17 at 10 13 18 pm

axel22 commented 8 years ago

Hi,

You should be using a an OfflineReport benchmark template, which generates an HTML report and does not report performance regressions (explanations of benchmark templates are in the docs). LocalTime should only measure the time and not produce any output.

You can see all the different benchmark templates here:

https://github.com/scalameter/scalameter/blob/master/src/main/scala/org/scalameter/Bench.scala

In case you need something more custom, then in the source code, you can also see how to set a custom measurer, warmer, reporter, etc. from how the benchmark templates are defined.

If you need already completed working examples, there is an examples directory at GitHub:

https://github.com/scalameter/scalameter-examples

This is an example of OfflineRegressionReport.

https://github.com/scalameter/scalameter-examples/blob/master/offline-regression-report/src/bench/scala/org/scalameter/examples/ListBenchmark.scala

anthonylau commented 8 years ago

Thanks a lot! But I come into this issue

[error] Could not run test TestBenchmark: java.lang.VerifyError: class com.fasterxml.jackson.module.scala.ser.ScalaIteratorSerializer overrides final method withResolved.(Lcom/fasterxml/jackson/databind/BeanProperty;Lcom/fasterxml/jackson/databind/jsontype/TypeSerializer;Lcom/fasterxml/jackson/databind/JsonSerializer;)Lcom/fasterxml/jackson/databind/ser/std/AsArraySerializerBase;

I have searched around, seems there is a conflict between fasterxml and jackson.

anthonylau commented 8 years ago

Fixed by excluding exclude("com.fasterxml.jackson.core", "jackson-databind")

axel22 commented 8 years ago

Thanks for reporting. This conflict is something we will need to fix for the next version.

michaelahlers commented 8 years ago

@axel22, thanks for the tip! I stumbled over the same problem with empty HTML reports.