RFR 4358774: Add null InputStream and OutputStream
Roger Riggs
Roger.Riggs at Oracle.com
Thu Dec 7 22:04:33 UTC 2017
Hi Brian,
For checking indices, I think you should leverage the work done for
java.util.Objects.checkFromIndexSize(...)
as optimized for this purpose in 8135248. That was extensively designed
and reviewed for optimal performance.
Regards, Roger
[1] https://bugs.openjdk.java.net/browse/JDK-8135248
On 12/7/2017 2:27 PM, Brian Burkhalter wrote:
> Updated patch:
>
> http://cr.openjdk.java.net/~bpb/4358774/webrev.01/
> <http://cr.openjdk.java.net/%7Ebpb/4358774/webrev.01/>
>
> On Dec 7, 2017, at 6:08 AM, Alan Bateman <Alan.Bateman at oracle.com
> <mailto:Alan.Bateman at oracle.com>> wrote:
>
>> If nothing else, a private ensureOpen method would make it easier to
>> read so that the "if (closed) throw ..." isn't needed in every method.
>
> Done.
>
> On Dec 6, 2017, at 7:03 PM, Vitaly Davidovich <vitalyd at gmail.com
> <mailto:vitalyd at gmail.com>> wrote:
>
>> From a performance angle, I'd be more concerned with the calls to
>> Objects.xyz() methods there. Unless something has changed in the JIT
>> recently, those are susceptible to profile pollution and can cause
>> missed optimizations. I'd inline those methods manually to give
>> these methods their own profiles.
>
> Done.
>
> Thanks,
>
> Brian
More information about the core-libs-dev
mailing list