RFR: 8361209: (bf) Use CharSequence::getChars for StringCharBuffer bulk get methods [v2]

Brian Burkhalter bpb at openjdk.org
Tue Jul 15 21:35:01 UTC 2025


On Tue, 15 Jul 2025 11:17:37 GMT, Brett Okken <duke at openjdk.org> wrote:

> Would it be simpler to make that method package scope and override it in StringCharBuffer?

Yes, that is definitely cleaner and simpler and uses less code. Please see dce00b5. Thanks for the suggestion!

> If the source is a `StringCharBuffer` and the instance we are putting into has a `char[]`, we should be able to use bulk transfer.

Yes, this works. Please again see dce00b5. I also added a `@Benchmark` to the micro to cover this. Performance is about 5x versus before.

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

PR Comment: https://git.openjdk.org/jdk/pull/26251#issuecomment-3075774759
PR Comment: https://git.openjdk.org/jdk/pull/26251#issuecomment-3075778666


More information about the nio-dev mailing list