8219876: (bf) Improve IndexOutOfBoundsException messages in $Type$Buffer classes

Brian Burkhalter brian.burkhalter at oracle.com
Thu Mar 14 23:06:05 UTC 2019


> On Mar 1, 2019, at 2:06 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> On 28/02/2019 21:57, Brian Burkhalter wrote:
>> 
>>> On Feb 27, 2019, at 11:57 PM, Alan Bateman <Alan.Bateman at oracle.com <mailto:Alan.Bateman at oracle.com>> wrote:
>>> 
>>> I assume you'll run benchmarks and/or look at the generated code to make sure that the checks inline as expected. 
>> 
>> 
>> The benchmark output [1] shows a small improvement for a 1024-byte bulk get and a slight degradation for a 1-byte bulk get. The benchmark code is [2].
>> 
>> The disassembled classes [3] (from ‘javap -c’) differ in the presence of a “pop” for the new code containing Objects.checkFromIndexSize().
>> 
> I should have been clearer, I meant the code generated at runtime, as in -XX:+PrintAssembly but if you are doing benchmarks to make sure the changes don't regress then it should be good.

I have to say that the generated code as in -XX:+PrintAssembly remains inscrutable to me, but I re-ran the benchmark with before and after release builds on a more or less quiescent system and the proposed change actually shows a small performance improvement for both 1- and 1024-byte bulk gets [1].

While we are at it, modifying the original patch [2] as suggested in [3] might be worthwhile. The delta is at [4] with the composite patch at [5].

Thanks,

Brian

[1] Benchmark output
[1A] Before

Benchmark                 Mode  Cnt          Score          Error  Units
CheckBounds.bulkGet1     thrpt   10  168709599.809 ± 18518204.156  ops/s
CheckBounds.bulkGet1024  thrpt   10   31044391.178 ±   402021.088  ops/s

[1B] After

Benchmark                 Mode  Cnt          Score         Error  Units
CheckBounds.bulkGet1     thrpt   10  175271277.362 ± 2458135.860  ops/s
CheckBounds.bulkGet1024  thrpt   10   32265609.310 ±  400376.804  ops/s

[2] http://cr.openjdk.java.net/~bpb/8219876/webrev.00/
[3] http://mail.openjdk.java.net/pipermail/nio-dev/2019-March/005954.html
[4] http://cr.openjdk.java.net/~bpb/8219876/webrev.00-01/
[5] http://cr.openjdk.java.net/~bpb/8219876/webrev.01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190314/0dc1076d/attachment-0001.html>


More information about the nio-dev mailing list