RFR: 8360783: CTW: Skip deoptimization between tiers

Aleksey Shipilev shade at openjdk.org
Fri Jun 27 08:26:10 UTC 2025


When profiling CTW runs, I noticed we spend a lot of time dealing with deoptimization. We do this excessively, deoptimizing before compilation on every tier. This is excessive: Hotspot honors compilation requests on subsequent levels without the need for explicit deoptimization. Not doing deopt between tiers greatly improves CTW performance. 

A taste of improvements, about 15% less CPU spent:


$ time make test TEST=applications/ctw/modules

# Current
real	5m1.616s
user	79m41.398s
sys	14m39.607s

# Patched
real	3m55.411s
user	69m19.227s
sys	5m24.323s


The compilation still works as expected, progressing through tiers 1..4:


$ JAVA_OPTIONS="-XX:+PrintCompilation -XX:CICompilerCount=2" ./ctw.sh modules:jdk.compiler | tee out
...
$ grep sun.tools.serialver.resources.serialver_de::getContents out
101783 55033    b  1       sun.tools.serialver.resources.serialver_de::getContents (108 bytes)
101785 55036    b  2       sun.tools.serialver.resources.serialver_de::getContents (108 bytes)
101786 55033       1       sun.tools.serialver.resources.serialver_de::getContents (108 bytes)   made not entrant: not used
101786 55038    b  3       sun.tools.serialver.resources.serialver_de::getContents (108 bytes)
101787 55036       2       sun.tools.serialver.resources.serialver_de::getContents (108 bytes)   made not entrant: not used
101792 55040    b  4       sun.tools.serialver.resources.serialver_de::getContents (108 bytes)
101797 55038       3       sun.tools.serialver.resources.serialver_de::getContents (108 bytes)   made not entrant: not used
101798 55040       4       sun.tools.serialver.resources.serialver_de::getContents (108 bytes)   made not entrant: marked for deoptimization

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

Commit messages:
 - Deopt

Changes: https://git.openjdk.org/jdk/pull/26013/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26013&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8360783
  Stats: 8 lines in 1 file changed: 6 ins; 1 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/26013.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26013/head:pull/26013

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


More information about the hotspot-compiler-dev mailing list