[PATCH]: Forking benchmarks with long classpath on Windows (7)

Aleksey Shipilev shade at redhat.com
Mon Jan 22 17:27:13 UTC 2018


On 12/22/2017 09:12 PM, Dávid Karnok wrote:
> Unfortunately, the system property approach doesn't work. The JMH plugin (0.4.5) can only set the
> `jvmArgs*` and not the -D param on the task that
> runs the parent JMH process. (I.e., it would require a change here:
> https://github.com/melix/jmh-gradle-plugin/blob/19ff7a4ed013e7980ef162534e0fefc91536d12c/src/main/groovy/me/champeau/gradle/JMHTask.java#L64)
> 
> I don't have much hope the plugin would evolve in reasonable time to accomodate this property so I
> suggest adding a workaround
> for checking for the flag:
> 
> String jvmargs = ""
> + options.getJvmArgs().orElse(Collections.<String>emptyList())
>     + options.getJvmArgsPrepend().orElse(Collections.<String>emptyList())
>     + options.getJvmArgsAppend().orElse(Collections.<String>emptyList());
> 
> 
> if (Boolean.getBoolean("jmh.separateClasspathJAR")
>         || jvmargs.contains("jmh.separateClasspathJAR=true")) {
> 
> 
> With this change, my benchmarks executed under Gradle 4.3.1, JMH Plugin 0.4.5 and setting jvmArgs.

All right, fine! Let's do this:
  http://cr.openjdk.java.net/~shade/jmh/long-classpath-2.patch

If you can sanity-check it still works for you, I'll push.

Thanks,
-Aleksey




More information about the jmh-dev mailing list