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

FR: Add ability to ignore/disable benchmarks classes or benchmark methods.

Open Kietyo opened this issue 2 years ago • 4 comments

Would like an @Ignore or @Disable annotation for this.

Kietyo avatar Aug 16 '22 08:08 Kietyo

Hi, It is currently possible to include/exclude benchmark classes and methods with benchmark configuration settings. e.g. https://github.com/Kotlin/kotlinx-benchmark/blob/8a96e0d631bf2d813af41650583557167a6fec24/examples/kotlin-multiplatform/build.gradle#L75

See README.md for details.

Please let me know if those settings do not help in your use case.

qurbonzoda avatar Aug 16 '22 19:08 qurbonzoda

Thanks that works but I would still like to be able to disable certain benchmark methods to avoid re-running methods that I've already ran in the past.

e.g:

@Benchmark
@Ignore
fun benchy() { ... }

Kietyo avatar Aug 16 '22 21:08 Kietyo

Unfortunately, we are constrained by JMH capabilities. Adding an annotation that JMH does not support would require us to process the annotations within kotlinx-benchmark.

qurbonzoda avatar May 27 '24 15:05 qurbonzoda

Just curious, what advantages such annotations could give comparing to @Benchmark being removed / commented out?

When it comes to testing, @Ignoreed tests are usually reported as being skipped, which is a valuable outcome. However, there are no such reports for benchmarks.

fzhinkin avatar May 27 '24 15:05 fzhinkin