Kotlin / kotlinx-benchmark

Kotlin multiplatform benchmarking toolkit
Apache License 2.0
513 stars 41 forks source link

State annotation should not be mandatory for benchmark class #29

Open Munzey opened 3 years ago

Munzey commented 3 years ago

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.

qurbonzoda commented 5 months ago

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.