RFR: 8305811: (bf) Improve performance of CharBuffer::append(CharSequence[,int,int]) [v8]
Alan Bateman
alanb at openjdk.org
Mon Apr 17 17:17:34 UTC 2023
On Mon, 17 Apr 2023 15:23:56 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template line 315:
>>
>>> 313: #if[rw]
>>> 314: if (csq instanceof StringBuilder)
>>> 315: return appendChars(csq, 0, csq.length());
>>
>> No special casing of String here as append(String) as the implementation in the base class uses put(String) so nothing to be gained.
>>
>> No special casing of StringBuffer as it is legacy/not-interesting. Also it's caching of the String value means you don't see the difference in micros, is that right?
>
> Comments added in https://github.com/openjdk/jdk/pull/13415/commits/c18565eb822aa96a49169c4fffe9ebe203599356.
I think this new comment is confusing as it's a reply to a question in the PR rather than to someone reading the code :-) I think in ab5fe71c without this comment was ready to go.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13415#discussion_r1169044741
More information about the nio-dev
mailing list