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
Having looked at the plugin code I was not able to find a way to change the location of generated benchmark classes.
With a typical gradle setup, whereby JMH sources are under src/jmh, running the benchmarks with the help of this plugin causes the JmhBytecodeGenerator to write generated java code under src/jmh/generated_tests.
Would it be possible to make this configurable?
Having looked (just a bit) at the JMH code as well, it appears JmhBytecodeGenerator accepts that path as command line argument.
But I couldn't find a way to pass a different value. I think generated_tests is some default from IDEA - not sure how we could change it. Any ideas? Am I missing something?
Ideally:
the gradle jmh plugin would allow us to customize this location
Upon import, IntelliJ would adapt and pass the option to the JMH runner.
Thank you very much!
The text was updated successfully, but these errors were encountered:
Sorry, I probably can't help you. Usually the JMH benchmarks are created as a separate Maven project that can import modules from the project that you wish to test. The JMH uses a Maven plugin to generate code wrapped in JMH sampling code. So Gradle support may not work at all.
The recommended way to run a JMH benchmark is to use Maven to setup a standalone project that depends on the jar files of your application. This approach is preferred to ensure that the benchmarks are correctly initialized and produce reliable results. It is possible to run benchmarks from within an existing project, and even from within an IDE, however setup is more complex and the results are less reliable.
In all cases, the key to using JMH is enabling the annotation- or bytecode-processors to generate the synthetic benchmark code. Maven archetypes are the primary mechanism used to bootstrap the project that has the proper build configuration. We strongly recommend new users make use of the archetype to setup the correct environment.
But I may check later (probably in a year) the usage scenario that you described.
Idea plugin development is very time expensive so keep away from it :)
This is not critical feature at all. So unless others will request it we probabbly won't do anything in the direction. Let's keep the issue open and see for votes
Having looked at the plugin code I was not able to find a way to change the location of generated benchmark classes.
With a typical gradle setup, whereby JMH sources are under
src/jmh
, running the benchmarks with the help of this plugin causes the JmhBytecodeGenerator to write generated java code undersrc/jmh/generated_tests
.Would it be possible to make this configurable?
Having looked (just a bit) at the JMH code as well, it appears
JmhBytecodeGenerator
accepts that path as command line argument.But I couldn't find a way to pass a different value. I think generated_tests is some default from IDEA - not sure how we could change it. Any ideas? Am I missing something?
Ideally:
Thank you very much!
The text was updated successfully, but these errors were encountered: