RFR: 7903916: JMH: Faster self-PID getters [v2]
Aleksey Shipilev
shade at openjdk.org
Tue Dec 17 13:36:10 UTC 2024
> In current GHA, macos-aarch64 runners are extremely slow. There is about 5 second delay between the last two lines:
>
>
> Tue, 17 Dec 2024 11:20:33 GMT Forking using command: [/Users/runner/hostedtoolcache/Java_Corretto_jdk/21.0.5-11.1/arm64/Contents/Home/bin/java, -XX:+UnlockDiagnosticVMOptions, -XX:+UnlockExperimentalVMOptions, -DcompilerBlackholesEnabled=true, -XX:CompileCommandFile=/var/folders/3s/b36dp_4s3wv3byw057j8bp940000gn/T/jmh8396366506527642092compilecommand, -cp, /Users/runner/work/gha-perf-test/gha-perf-test/target/test-classes:/Users/runner/work/gha-perf-test/gha-perf-test/target/classes:/Users/runner/.m2/repository/junit/junit/4.13.1/junit-4.13.1.jar:/Users/runner/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/Users/runner/.m2/repository/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar:/Users/runner/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/Users/runner/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar:/Users/runner/.m2/repository/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37
.jar:, org.openjdk.jmh.runner.ForkedMain, 127.0.0.1, 49183]
> Tue, 17 Dec 2024 11:20:33 GMT # Fork: 1 of 1
> Tue, 17 Dec 2024 11:20:40 GMT # Warmup Iteration 1: 1345765548.585 ops/s
>
>
> I figured there is a problem in `Utils.getPID()` that ends up resolving its own hostname as part of `ManagementFactory.getRuntimeMXBean().getName()` call. We can do better and shortcut this.
Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
Revert PID detection to Forked JVM again. getPid(Process) does not work on Windows and JDK 8...
-------------
Changes:
- all: https://git.openjdk.org/jmh/pull/152/files
- new: https://git.openjdk.org/jmh/pull/152/files/294bb2e9..d88e3204
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jmh&pr=152&range=01
- incr: https://webrevs.openjdk.org/?repo=jmh&pr=152&range=00-01
Stats: 17 lines in 4 files changed: 11 ins; 5 del; 1 mod
Patch: https://git.openjdk.org/jmh/pull/152.diff
Fetch: git fetch https://git.openjdk.org/jmh.git pull/152/head:pull/152
PR: https://git.openjdk.org/jmh/pull/152
More information about the jmh-dev
mailing list