Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v9]

2023-04-06 Thread Jaikiran Pai
On Thu, 6 Apr 2023 09:55:57 GMT, Sergey Tsypanov wrote: >>> So I think the main thing now is to decide whether the benchmark should be >>> included or not. >> >> In my review I hadn't paid attention to the benchmark class. I now applied >> this patch locally and reviewed the benchmark code and

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v9]

2023-04-06 Thread Sergey Tsypanov
On Thu, 6 Apr 2023 09:23:33 GMT, Jaikiran Pai wrote: > For this change, I think a benchmark isn't necessary - what would it test, > how quickly a new BufferedInputStream returns as compared to previous code? @jaikiran first of all it demonstrates reducing allocation for plain/cascaded readAll

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v9]

2023-04-06 Thread Jaikiran Pai
On Wed, 5 Apr 2023 07:08:58 GMT, Alan Bateman wrote: > So I think the main thing now is to decide whether the benchmark should be > included or not. In my review I hadn't paid attention to the benchmark class. I now applied this patch locally and reviewed the benchmark code and even ran it loc

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v9]

2023-04-05 Thread Alan Bateman
On Mon, 27 Mar 2023 16:18:22 GMT, Sergey Tsypanov wrote: >> By default `BufferedInputStream` is constructed with internal buffer with >> capacity 8192. In some cases this buffer is never used, e.g. when we call >> `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >> `

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v9]

2023-04-05 Thread Jaikiran Pai
On Mon, 27 Mar 2023 16:18:22 GMT, Sergey Tsypanov wrote: >> By default `BufferedInputStream` is constructed with internal buffer with >> capacity 8192. In some cases this buffer is never used, e.g. when we call >> `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >> `

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v9]

2023-04-04 Thread Brian Burkhalter
On Mon, 27 Mar 2023 16:18:22 GMT, Sergey Tsypanov wrote: >> By default `BufferedInputStream` is constructed with internal buffer with >> capacity 8192. In some cases this buffer is never used, e.g. when we call >> `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >> `

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v9]

2023-04-04 Thread Brian Burkhalter
On Mon, 27 Mar 2023 16:18:22 GMT, Sergey Tsypanov wrote: >> By default `BufferedInputStream` is constructed with internal buffer with >> capacity 8192. In some cases this buffer is never used, e.g. when we call >> `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >> `

Re: RFR: 8304745: Lazily initialize byte[] in java.io.BufferedInputStream [v9]

2023-03-27 Thread Sergey Tsypanov
> By default `BufferedInputStream` is constructed with internal buffer with > capacity 8192. In some cases this buffer is never used, e.g. when we call > `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when > `BufferedInputStream` is cascaded. Sergey Tsypanov has updated