RFR 8193832: Performance of InputStream.readAllBytes() could be improved
brian.burkhalter at oracle.com
Wed Dec 20 22:30:41 UTC 2017
On Dec 20, 2017, at 11:52 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
> I was a little lassiaz-faire given that 8K bytes were anyway being allocated upfront. Peter’s changes look good.
> Brian, i would double check the tests to make sure the various code paths are tested.
The patch is updated to:
* use Peter’s approach to avoid allocating an ArrayList when length <= DEFAULT_BUFFER_SIZE;
* use the default ArrayList constructor instead of that with a specific initial capacity;
* update the test to ensure that lengths which require three buffers are covered.
More information about the core-libs-dev