kotlinx-benchmark icon indicating copy to clipboard operation
kotlinx-benchmark copied to clipboard

State annotation should not be mandatory for benchmark class

Open Munzey opened this issue 4 years ago • 1 comments
trafficstars

Good description of what jmh state is for.

It doesn't seem correct that for the js benchmark to run you must annotate the class with @State(Scope.Benchmark).

I believe the only requirement should be for the benchmark functions to be annotated with @Benchmark.

If it is an intentional requirement, then I think it should be mentioned in the README.

Munzey avatar Feb 08 '21 17:02 Munzey

Hi,

We have explicitly documented the requirement in the README and in our guide for writing benchmarks. However, I agree that the annotation should not be mandatory for benchmark classes in general. I will leave this issue open to continue tracking it.

qurbonzoda avatar May 27 '24 17:05 qurbonzoda