RFR: CODETOOLS-7903004: JMH: Compiler Blackholes auto-detection [v7]

Aleksey Shipilev shade at openjdk.java.net
Thu Aug 5 10:22:04 UTC 2021


> This is another step towards better [compiler blackholes](https://shipilev.net/jvm/anatomy-quarks/27-compiler-blackholes/) support. This time, we can teach JMH to auto-detect the support. This improves the UX by asking users to supply `-Djmh.blackhole.autoDetect` for this experimental machinery to work. This would then use compiler blackholes for JDK 17+ and full blackholes for everything else. It would also check that compiler blackholes are available when users force it.
> 
> All in all, this prevents from accidentally enabling compiler blackholes for JVMs that do not support it, and allows for a consistent JMH invocation line across all JVM versions.
> 
> We would explore enabling auto-detection by default at the later time.

Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:

  Chicken out: make auto-detect false by default, leave everything else intact

-------------

Changes:
  - all: https://git.openjdk.java.net/jmh/pull/48/files
  - new: https://git.openjdk.java.net/jmh/pull/48/files/40542021..c91d5d61

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jmh&pr=48&range=06
 - incr: https://webrevs.openjdk.java.net/?repo=jmh&pr=48&range=05-06

  Stats: 12 lines in 1 file changed: 4 ins; 0 del; 8 mod
  Patch: https://git.openjdk.java.net/jmh/pull/48.diff
  Fetch: git fetch https://git.openjdk.java.net/jmh pull/48/head:pull/48

PR: https://git.openjdk.java.net/jmh/pull/48


More information about the jmh-dev mailing list