RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps

Phil Race prr at openjdk.org
Tue Oct 29 22:21:23 UTC 2024


On Tue, 29 Oct 2024 16:20:53 GMT, Daniel Gredler <duke at openjdk.org> wrote:

>> https://bugs.openjdk.org/browse/JDK-8338677 already improved things for this so that's good.
>> 
>> This fix adds to it lazy initialisation of VarHandles in StrikeCache at the cost of some extra code.
>> Since these VarHandles get used more or less immediately on Linux this new fix won't further improve matters there
>> But should help on Mac where they aren't usually needed at startup
>> And Windows is somewhere in between.
>
> src/java.desktop/share/classes/sun/font/StrikeCache.java line 150:
> 
>> 148:     private static VarHandle imageHandle;
>> 149: 
>> 150:     private static VarHandle getXAdvanceHandle() {
> 
> Quick question: is there no concern with multi-threading / race conditions for these lazy creation methods? (e.g. requiring double-checked locking or similar)
> 
> This looks like a good use case for `StableValue`, if it were ready!

There won't be multiple threads except in some really unusual case so I don't think it is a problem

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21748#discussion_r1821597673


More information about the client-libs-dev mailing list