Je ne peux pas comprendre comment faire des benchmarks de programmes Scala dans Intellij avec JMH.Comment bancer Scala avec JMH dans Intellij?
Voici ce que je l'ai fait jusqu'à présent:
Ajouté le JMH SBT-Plugin
// build.sbt
name := "Project"
version := "1.0"
scalaVersion := "2.11.8"
enablePlugins(JmhPlugin)
// project/plugins.sbt
logLevel := Level.Warn
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.10")
Voici le plugin's website
créé une classe de référence
// src/main/scala/MyBenchmark.scala
import org.openjdk.jmh.annotations.Benchmark
class MyBenchmark {
@Benchmark
def test(): Unit = println("test")
}
Création d'un SBT-tâche dans Intellij
Mais après l'exécution de la tâche que j'obtenir juste une exception:
Annotation generator had thrown the exception.
java.lang.NullPointerException
at org.openjdk.jmh.generators.reflection.RFClassInfo.getPackageName(RFClassInfo.java:51)
at org.openjdk.jmh.generators.core.BenchmarkGenerator.validateBenchmark(BenchmarkGenerator.java:243)
at org.openjdk.jmh.generators.core.BenchmarkGenerator.generate(BenchmarkGenerator.java:90)
....
Qu'est-ce que je fais mal?