On Sat, 13 Mar 2021 14:28:25 GMT, Philippe Marschall <github.com+471021+marsch...@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 src/java.base/share/classes/java/io/Reader.java line 205: > 203: target.put(cbuf, 0, nread); > 204: } > 205: return nread; Thanks for bringing this back to just the heap buffer case. This part looks good now. ------------- PR: https://git.openjdk.java.net/jdk/pull/1915