RFR: 4926314: Optimize Reader.read(CharBuffer) [v4]

Philippe Marschall github.com+471021+marschall at openjdk.java.net
Sat Jan 9 23:06:22 UTC 2021

> 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 incrementally with one additional commit since the last revision:

  Add unit tests
  - add unit test for Reader#read(CharBuffer)
  - add unit test for InputStreamReader#reader(CharBuffer)
  - test with both on-heap and off-heap buffers


  - all: https://git.openjdk.java.net/jdk/pull/1915/files
  - new: https://git.openjdk.java.net/jdk/pull/1915/files/8d405587..d247b637

 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1915&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1915&range=02-03

  Stats: 170 lines in 2 files changed: 170 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1915.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1915/head:pull/1915

PR: https://git.openjdk.java.net/jdk/pull/1915

More information about the core-libs-dev mailing list