Open hbf opened 7 years ago
I also need this.
This would allow me to use custom classloader (LaunchWrapper in my case) which would make much easier to benchmark code that uses any kind of instrumentation, without copypasting and modifying all of the used/referenced parts.
any news regarding this?
+1. It seems strange that the only way to provide configuration is through options in build.gradle
.
I just stumbled upon this, because I was confused that the configuration options in build.gradle
seem to not get preserved in the jar generated by jmhJar
and was looking for a way to persist the configuration somewhere.
Is there any way to build a jar with the desired configuration so that the jar can be sent to another machine and simply be executed there via java -jar mybenchmark.jar
? Currently it seems the only way is to launch the benchmark with the desired options manually like java -jar mybenchmark.jar -wi 5 -bm avgt
.
On the Java side, we can use JMH's
Runner
to define amain
method that you can call. This makes it very easy to:forks
,jvmArgs
, etc.) and have these settings close (in the same source file!) to the benchmarkI'm not sure whether JMH's
Runner
works with the newJmhBytecodeGenerator
that we use on the Scala side but if so, would it be possible to supportRunner
's? For example, to allow the user of jmh-gradle-plugin to her/himself write:I didn't get this to work, even after a
./gradlew jmhCompileGeneratedClasses
:Error in IntelliJ when running the above
MyBenchmarkRunner.main()
:But on the command line I see: