Integrated: 8346264: "Total compile time" counter should include time spent in failing/bailout compiles

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


On Mon, 16 Dec 2024 10:56:48 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

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

This pull request has now been integrated.

Changeset: 12700cb8
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/12700cb81bdfc006bcd228e43b509b8810af6549
Stats:     11 lines in 1 file changed: 5 ins; 6 del; 0 mod

8346264: "Total compile time" counter should include time spent in failing/bailout compiles

Reviewed-by: kvn, mli

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

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


More information about the hotspot-compiler-dev mailing list