On Thu, 15 Jan 2026 19:39:28 GMT, Naoto Sato <[email protected]> wrote:

>> Liam Miller-Cushon has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Review feedback
>
> src/java.base/share/classes/java/lang/String.java line 2127:
> 
>> 2125:      * <p>The result will be the same value as {@link 
>> #getBytes(Charset) getBytes(cs).length}.
>> 2126:      *
>> 2127:      * @implNote This method may allocate memory to compute the length 
>> for some charsets.
> 
> Would it help if we describe the benefit of this method? Ie, for some 
> charsets it won't allocate memory thus faster than getBytes(Charset)?

I think that makes sense, I'm not sure what the best way to characterize it is. 
Probably we don't want to promise specific optimizations. What do you think 
about:


     * <p>The result will be the same value as {@link #getBytes(Charset) 
getBytes(cs).length},
     * and will have equivalent or better performance.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28454#discussion_r2695775575

Reply via email to