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

Eirik Bjorsnos duke at openjdk.org
Sat Mar 25 05:58:34 UTC 2023


On Fri, 24 Mar 2023 19:30:22 GMT, Sergey Tsypanov <stsypanov at openjdk.org> 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 `BufferedInputStream` is cascaded.
>
> Sergey Tsypanov has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'origin/8304745' into 8304745
>    
>    # Conflicts:
>    #	test/micro/org/openjdk/bench/java/io/BufferedInputStreamBenchmark.java
>  - 8304745: Fix line breaks

I think the benchmark would benefit with a few words explaining why you focused on those methods/calling patterns. For someone walking past this benchmark, this is not obvious why you picked those.

Either a class block comment or block comments for each of the benchmark methods would help understandability.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13150#issuecomment-1483735781


More information about the core-libs-dev mailing list