RFR: 8155600 - Performance optimization of Arrays.asList().iterator()

Aleksey Shipilev aleksey.shipilev at oracle.com
Fri Apr 29 12:49:04 UTC 2016


On 04/29/2016 03:40 PM, Tagir F. Valeev wrote:
> http://cr.openjdk.java.net/~tvaleev/webrev/8155600/r2/

JDK part looks good to me.

Test:
 *) Formatting: "i=0", "i<array.length", etc should have spaces;
 *) Formatting: "} catch (NSEE ex)" should be on the same line;
 *) What does the "for (int i=0; i<3; i++) {" thing test?
 *) No need for "parallel = true", should be fine with sequential;
 *) The idiom for exception testing is more self-contained:

 try {
   itr.next();
   fail("Should have thrown NSEE");
 } catch (NSEE ex) {
   // expected
 }

 *) Probably need to add these cases too, to boundary-test the null
handling:
    {null}
    {null, 1}
    {1, null}
    {null, null}
    {null, 1, 2}
    {1, null, 2}
    {1, 2, null}
    {null, null, null}

> AS>  *) Does EA break if you make ArrayItr inner class to gain the access to
> AS> E[] a?
> 
> No, I checked, it still allocates.

Yeah, this seems to be an issue with EA, investigating... We can push
this iterator in current form meanwhile.

Thanks,
-Aleksey




More information about the core-libs-dev mailing list