RFR: 8201650: Move iteration order randomization of unmodifiable Set and Map to iterators

Jiangli Zhou jiangli.zhou at oracle.com
Thu Apr 19 00:04:50 UTC 2018


Hi Claes,

Moving the use of SALT to iterator creation is a great idea! You change looks really good.

Thanks for making the change!

Jiangli

> On Apr 18, 2018, at 8:20 AM, Claes Redestad <claes.redestad at oracle.com> wrote:
> 
> Hi,
> 
> please review this change that moves the use of SALT to iterator creation, which would allow for certain startup
> optimizations in the future.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8201650
> Webrev: http://cr.openjdk.java.net/~redestad/8201650/open.00/
> 
> This does make the randomness of iteration order weaker as we're only randomizing the starting point (varying with
> the size of the collection) and the iteration direction (run-to-run variant; weaker than calculating per size, but
> allows this patch to be performance neutral).
> 
> Some Set/Map operations become very slightly faster with this patch, but that's in the noise. Iterator operations
> remain largely performance neutral, sometimes even a bit faster.
> 
> Thanks!
> 
> /Claes
> 
> 
> 



More information about the core-libs-dev mailing list