melix / jmh-gradle-plugin

Integrates the JMH benchmarking framework with Gradle
Apache License 2.0
659 stars 88 forks source link

Setting timeUnit in build.gradle.kts always overrides @OutputTimeUnit annotations #258

Open felldo opened 7 months ago

felldo commented 7 months ago

Describe the bug When setting the timeUnit configuration, it always overrides any other setup OutputTimeUnit. For example you set the gradle configuration timeUnit to ms, you can no longer use the @OutputTimeUnit annotation to change it for a specific class or method. When removing the configurations, the annotations start working again.

To Reproduce Steps to reproduce the behavior:

  1. Add timeUnit = "ms" to your jmh configuration in the build.gradle.kts file
  2. Add a @OutputTimeUnit(TimeUnit.NANOSECONDS) to a method or class benchmark.
  3. The result output is alway set to the value defined in the gradle configuration. When removing the configuration, setting it on the class and method level works with different values