RFR: 8355177: Speed up StringBuilder::append(char[]) via Unsafe::copyMemory [v4]
Markus KARG
duke at openjdk.org
Sat May 17 13:05:50 UTC 2025
On Fri, 2 May 2025 07:13:21 GMT, Shaojin Wen <swen at openjdk.org> wrote:
>>> ```java
>>> > char[] ca = new char[end - off];
>>> ```
>>>
>>> Your code here has a memory allocation, which may cause slowdown
>>
>> This is exactly what I wanted to express with my posting.
>
>> > ```java
>> > > char[] ca = new char[end - off];
>> > ```
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > Your code here has a memory allocation, which may cause slowdown
>>
>> This is exactly what I wanted to express with my posting.
>
> I agree with you that this PR can improve the performance of Reader's method ` int read(char[] cbuf, int off, int len)`, but may not help the performance of Reader::getChars.
@wenshao Why did you remove UTF16::compress from your proposal? Wasn't it providing the expected benefit?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24773#issuecomment-2888375783
More information about the core-libs-dev
mailing list