RFR: 8368465: [leyden] Improve precompiler method selection code [v4]

Vladimir Kozlov kvn at openjdk.org
Sat Oct 18 00:11:28 UTC 2025


On Fri, 17 Oct 2025 21:35:04 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Forked from [JDK-8366681](https://bugs.openjdk.org/browse/JDK-8366681): there are still some cleanups/performance improvements possible. Current selection code is a bit hairy, and turns out the changes I made for previous patch improve performance.
>> 
>> Notable improvements:
>>  1. Push the compilation level filters downwards. This allows compiling A2 from T2/T3 code more easily, and allows to implement policies for compiling on any A* level based on observing top-compiled T* levels.
>>  2. Sort methods by hotness and code size. This looks to have a positive effect on shorter workloads, I suspect because we are avoiding a lot of C1 compilations by preloading hottest code first.
>> 
>> Additional testing:
>>  - [x] Performance tests (see comments)
>>  - [x] Linux x86_64 server fastdebug, `runtime/cds`
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Drop the mention of MDO

I think we have small performance "issue" how we replace existing JITed code with new one which AOT code loading could be more sensitive. We deoptimize old code before new code is set under lock `NMethodState_lock `:
https://github.com/openjdk/leyden/blob/premain/src/hotspot/share/ci/ciEnv.cpp#L1058

If lock is held by other thread we may deoptimize previous code and go into interpreter before new code is set for use.

This is present in mainline but with normal JIT compilation replacement it may be not noticeable.

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

PR Comment: https://git.openjdk.org/leyden/pull/99#issuecomment-3417547444


More information about the leyden-dev mailing list