RFR: 8368321: Rethink compilation delay strategy for lukewarm methods [v2]
Vladimir Ivanov
vlivanov at openjdk.org
Fri Oct 24 21:33:01 UTC 2025
On Wed, 22 Oct 2025 01:36:39 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.
>
> Igor Veresov has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix zero build
Looks good.
-------------
Marked as reviewed by vlivanov (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/27926#pullrequestreview-3378908589
More information about the hotspot-compiler-dev
mailing list