Integrated: 8360783: CTW: Skip deoptimization between tiers

Aleksey Shipilev shade at openjdk.org
Tue Jul 1 08:02:45 UTC 2025


On Fri, 27 Jun 2025 08:19:34 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

This pull request has now been integrated.

Changeset: cd6caedd
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/cd6caedd0a3c9ebd4c8c57e64f62b60161c5cd7c
Stats:     8 lines in 1 file changed: 6 ins; 1 del; 1 mod

8360783: CTW: Skip deoptimization between tiers

Reviewed-by: thartmann, mhaessig, dfenacci

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

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


More information about the hotspot-compiler-dev mailing list