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.bate...@oracle.com <mailto:alan.bate...@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 <vita...@gmail.com <mailto:vita...@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

Reply via email to