You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run interactive sbt session and start jmh benchmark that contains some errors.
The session halts on error.
Is it possible to keep session running?
sbt
jmh:run
[info] Done packaging.
@TearDown annotation is placed within the class not having @State annotation. This has no behavioral effect, and prohibited.
[org.openjdk.jmh.generators.reflection.RFMethodInfo@4234de75]
Sample code to reproduce:
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
object TestBenchmark {
@State(Scope.Benchmark)
class BenchmarkState {
@Param(Array("25", "50", "100", "1000"))
var elementsCount: Int = 0
var items: Seq[Int] = _
}
@Setup
def setup(state: BenchmarkState): Unit = {
state.items = (0 until state.elementsCount)
}
}
@Warmup(iterations = 5, time = 1)
@Measurement(iterations = 5, time = 1)
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(value = TimeUnit.MICROSECONDS)
class TestBenchmark {
import TestBenchmark._
@Benchmark
def benchmarkSize(state: BenchmarkState): Unit = {
state.items.size
}
}
The text was updated successfully, but these errors were encountered:
@f1yegor It seems no one would write like this way. There are some examples that you could see how to write with JMH. ListBenchmark.scala from Scala's repository or TestBenchmark.scal from this repository.
I run interactive sbt session and start jmh benchmark that contains some errors.
The session halts on error.
Is it possible to keep session running?
Sample code to reproduce:
The text was updated successfully, but these errors were encountered: