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

Dávid Karnok akarnokd at gmail.com
Mon Jan 22 17:55:44 UTC 2018


Thanks Aleksey, the 1.20 patch works:

# JMH version: 1.19
# VM version: JDK 1.8.0_162, VM 25.162-b12
# VM invoker: C:\Program Files\Java\jdk1.8.0_162\jre\bin\java.exe
# VM options: <none>
# Warmup: 5 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: io.reactivex.FlattenJustPerf.flowable
# Parameters: (times = 1)

# Run progress: 0,00% complete, ETA 00:02:20
# Fork: 1 of 1
<failed to invoke the VM, caught IOException: Cannot run program
"C:\Program Files\Java\jdk1.8.0_162\jre\bin\java.exe": CreateProcess
error=206, A fájlnév vagy a kiterjesztés túl hosszú>


# JMH version: 1.20-SNAPSHOT
# VM version: JDK 1.8.0_162, VM 25.162-b12
# VM invoker: C:\Program Files\Java\jdk1.8.0_162\jre\bin\java.exe
# VM options: -Djmh.separateClasspathJAR=true
# Warmup: 5 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: io.reactivex.FlattenJustPerf.flowable
# Parameters: (times = 1)

# Run progress: 0,00% complete, ETA 00:02:20
# Fork: 1 of 1
# Warmup Iteration   1: 22808968,264 ops/s
# Warmup Iteration   2: 23924488,213 ops/s
# Warmup Iteration   3: 25972212,907 ops/s
# Warmup Iteration   4: 25621809,089 ops/s
# Warmup Iteration   5: 26211772,303 ops/s
Iteration   1: 25449588,158 ops/s
Iteration   2: 25343894,842 ops/s
Iteration   3: 25234472,179 ops/s
Iteration   4: 25386835,113 ops/s
Iteration   5: 25836381,567 ops/s


2018-01-22 18:27 GMT+01:00 Aleksey Shipilev <shade at redhat.com>:

> 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
>
>
>


-- 
Best regards,
David Karnok


More information about the jmh-dev mailing list