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

Aleksey Shipilev shade at openjdk.org
Tue Sep 23 12:39:59 UTC 2025


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 avoids a fairly awkward path to get compile IDs, ditching which _I suspect_ is the cause for performance improvement. With new code, we compile a tad more A2 code. I have not digged through why current code accepts fewer methods for compilation. New code improves performance everywhere, so I suggest we just accept that and move on.

Additional testing:
 - [x] Performance tests (see comments)
 - [x] Linux x86_64 server fastdebug, `runtime/cds`

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

Commit messages:
 - Fix

Changes: https://git.openjdk.org/leyden/pull/99/files
  Webrev: https://webrevs.openjdk.org/?repo=leyden&pr=99&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8368465
  Stats: 116 lines in 4 files changed: 59 ins; 27 del; 30 mod
  Patch: https://git.openjdk.org/leyden/pull/99.diff
  Fetch: git fetch https://git.openjdk.org/leyden.git pull/99/head:pull/99

PR: https://git.openjdk.org/leyden/pull/99


More information about the leyden-dev mailing list