RFR: 8284638: store skip buffers in InputStream Object [v4]
XenoAmess
duke at openjdk.java.net
Thu Apr 14 18:01:35 UTC 2022
On Wed, 13 Apr 2022 22:59:13 GMT, liach <duke at openjdk.java.net> wrote:
>> XenoAmess has updated the pull request incrementally with one additional commit since the last revision:
>>
>> add jmh
>
> test/micro/org/openjdk/bench/java/io/InputStreamSkipBenchmark.java line 54:
>
>> 52: @Benchmark
>> 53: public long testSkip0(Data data) throws IOException {
>> 54: TestBaseInputStream0 testBaseInputStream = new TestBaseInputStream0(data.inputStreamSize);
>
> Instead of creating 3 methods with identical bodies, I recommend using an enum to represent the type of buffers. An example at https://github.com/openjdk/jdk/blob/7a9844cb1cd18c18ce097741cba7db1148c83de0/test/micro/org/openjdk/bench/java/util/HashMapBench.java#L65-L71
>
> For enum values, you can name them like `LOCAL_VARIABLE`, `FIELD`, `SOFT_REFERENCE`, which is more descriptive than current "0, 1, 2," etc.
@liach done.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5872
More information about the core-libs-dev
mailing list