Integrated: 8368321: Rethink compilation delay strategy for lukewarm methods

Igor Veresov iveresov at openjdk.org
Mon Oct 27 15:13:04 UTC 2025


On Wed, 22 Oct 2025 01:22:44 GMT, Igor Veresov <iveresov at openjdk.org> wrote:

> In the current implementation we delay profiling of lukewarm methods (those that were never compiled by C2 during training) by increasing the 2->3 threshold by a factor. That may shift profiling of those too much into the future if a large factor is used, if we use a small factor, however, profiling may happen within the training run window so to speak. The solution I came up with it to delay profiling until we reach the number of invocations of a method equal to the number we had in the training run. After that we use the normal policy.
> 
> Here is an example. I trained our JavacBenchApp for 5 iterations (which is artificially low and therefore many methods would be classified as lukewarm). Then I ran it for 200 iterations with AOT replay.
> 
> <img width="640" height="480" alt="old-vs-new" src="https://github.com/user-attachments/assets/7f758dc1-ad6d-4ae5-8519-ddab18410722" />
> 
> While initially the performance is similar it quickly diverges. With the new approach we move to standard handling of lukewarm methods after 5 iterations and they get compiled with C2. With the old approach we don't.

This pull request has now been integrated.

Changeset: 1e49376e
Author:    Igor Veresov <iveresov at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/1e49376ece39e8f9b5c72b58688b1e195a0014be
Stats:     70 lines in 5 files changed: 34 ins; 15 del; 21 mod

8368321: Rethink compilation delay strategy for lukewarm methods

Reviewed-by: kvn, vlivanov

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

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


More information about the hotspot-compiler-dev mailing list