RFR: 8336856: Optimize String Concat [v19]

Shaojin Wen duke at openjdk.org
Sun Jul 28 14:02:33 UTC 2024


On Sun, 28 Jul 2024 13:58:05 GMT, Shaojin Wen <duke at openjdk.org> wrote:

>> The current implementation of StringConcat is to mix the coder and length into a long. This operation will have some overhead for int/long/boolean types. We can separate the calculation of the coder from the calculation of the length, which can improve the performance in the scenario of concat int/long/boolean.
>> 
>> This idea comes from the suggestion of @l4es in the discussion of PR https://github.com/openjdk/jdk/pull/20253#issuecomment-2240412866
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   cache generate MethodHandle

I will aim to remove the MH-based implementation with minimal changes.

I added METHOD_HANDLE_CACHE to prevent the same pattern from being created repeatedly, but I'm not sure if this can make the class unloadable.

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

PR Comment: https://git.openjdk.org/jdk/pull/20273#issuecomment-2254529197


More information about the core-libs-dev mailing list