RFR: 4926314: Optimize Reader.read(CharBuffer) [v9]
Brian Burkhalter
bpb at openjdk.java.net
Fri Apr 16 17:05:43 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
test/jdk/java/io/CharArrayReader/ReadCharBuffer.java line 50:
> 48: @DataProvider(name = "buffers")
> 49: public Object[][] createBuffers() {
> 50: // test both on-heap and off-heap buffers has they may use different code paths
"as they may"
test/jdk/java/io/InputStreamReader/ReadCharBuffer.java line 52:
> 50: @DataProvider(name = "buffers")
> 51: public Object[][] createBuffers() {
> 52: // test both on-heap and off-heap buffers has they make use different code paths
"as they may"
test/jdk/java/io/Reader/ReadCharBuffer.java line 51:
> 49: @DataProvider(name = "buffers")
> 50: public Object[][] createBuffers() {
> 51: // test both on-heap and off-heap buffers has they make use different code paths
"as they may"
-------------
PR: https://git.openjdk.java.net/jdk/pull/1915
More information about the core-libs-dev
mailing list