On Fri, 8 Sep 2023 12:25:02 GMT, Claes Redestad <redes...@openjdk.org> wrote:

>> 温绍锦 has updated the pull request incrementally with one additional commit 
>> since the last revision:
>> 
>>   Continue to optimize and reduce duplicate code
>
> src/java.base/share/classes/java/lang/String.java line 699:
> 
>> 697:     }
>> 698: 
>> 699:     static String newStringLatin1NoRepl(byte[] bytes) {
> 
> How much does this help compared to calling `jla.newStringNoRepl(bytes, 
> StandardCharsets.ISO_8859_1)`? Maybe something that would be better split out 
> to a separate enhancement and examined in isolation and apply it in other 
> places where applicable (`java.util.UUID`, `java.util.HexFormat`)

newStringLatin1NoRepl does not significantly help performance, but it 
simplifies the code. 

Of course, there is another advantage: because the call will be simpler, making 
it easier for the caller method to implement codeSize smaller than the default 
value of FreqInlineSize 325, and there are more opportunities to be inlined.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15555#discussion_r1320022640

Reply via email to