RFR: 4926314: Optimize Reader.read(CharBuffer) [v9]
Alan Bateman
alanb at openjdk.java.net
Fri Apr 16 18:43:41 UTC 2021
On Sat, 13 Mar 2021 14:28:25 GMT, Philippe Marschall <github.com+471021+marschall at openjdk.org> wrote:
>> Implement three optimiztations for Reader.read(CharBuffer)
>>
>> * Add a code path for heap buffers in Reader#read to use the backing array instead of allocating a new one.
>> * Change the code path for direct buffers in Reader#read to limit the intermediate allocation to `TRANSFER_BUFFER_SIZE`.
>> * Implement `InputStreamReader#read(CharBuffer)` and delegate to `StreamDecoder`.
>> * Implement `StreamDecoder#read(CharBuffer)` and avoid buffer allocation.
>
> Philippe Marschall has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits:
>
> - Merge master
> - Fix bug in CharArrayReader and add unit test
> - Clean up unit tests
> - Revert off-heap code path
> - Replace c-style array declarations
> - Share work buffer between #skip and #read
> - Update copyright year
> - Implement review comment
> - Revert StreamDecoder changes
> - Implement CharArrayReader#read(CharBuffer)
> - ... and 5 more: https://git.openjdk.java.net/jdk/compare/d339320e...c4c859e0
Thanks for rolling back to the direct buffer case, the updated implementation changes look okay.
-------------
Marked as reviewed by alanb (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/1915
More information about the core-libs-dev
mailing list