RFR: 8346264: "Total compile time" counter should include time spent in failing/bailout compiles [v3]

Aleksey Shipilev shade at openjdk.org
Mon Jan 6 09:39:15 UTC 2025


> Noticed this when looking through JMH compiler profiler results.
> 
> Current `CompilerBroker` counters that are fed into `CompilationMXBean.getTotalCompilationTime()` and JFR `CompilerStatistics` only records the time for successful compilations. If we take a while in compilation and then fail/bail, that time would not be accounted for.
> 
> While this seems to be a long-standing behavior, there are problems with this:
>  1. This is not what "total" means.
>  2. This gives us a blind spot in measuring time taken in failing/bailing compilations.
>  3. It does not match well the Javadoc for `CompilationMXBean.getTotalCompilationTime()`: "Returns the approximate accumulated elapsed time (in milliseconds) spent in compilation." -- since the time spent in failing/bailing compilation is still time spent in compilation.
> 
> Additional testing:
>  - [x] Linux x86_64 server release, `jdk/jfr java/lang/management`

Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Merge branch 'master' into JDK-8346264-compmxbean-account-all
 - Update comment
 - Fix

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/22760/files
  - new: https://git.openjdk.org/jdk/pull/22760/files/67a11988..2ed82a16

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22760&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22760&range=01-02

  Stats: 20004 lines in 630 files changed: 14939 ins; 2945 del; 2120 mod
  Patch: https://git.openjdk.org/jdk/pull/22760.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22760/head:pull/22760

PR: https://git.openjdk.org/jdk/pull/22760


More information about the hotspot-compiler-dev mailing list