RFR: 8360783: CTW: Skip deoptimization between tiers [v2]

Manuel Hässig mhaessig at openjdk.org
Fri Jun 27 09:17:42 UTC 2025


On Fri, 27 Jun 2025 08:38:31 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> 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
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java
>   
>   Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>

Those are quite some time savings! Thank you for fixing this.

Looks good to me.

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

Marked as reviewed by mhaessig (Committer).

PR Review: https://git.openjdk.org/jdk/pull/26013#pullrequestreview-2965590557


More information about the hotspot-compiler-dev mailing list