On Mon, 28 Oct 2024 21:26:38 GMT, Phil Race <[email protected]> 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.

Are you sure all these var handles are rarely used (not on hot code path)?  
This current patch can slow down the use of these var handles by many times.  
If this is startup-only, we can probably just create the vh once, invoke it, 
and discard it, or look into FFM API and see if we have better one-time 
invocation solutions.

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

PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2521939803

Reply via email to