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

Claes Redestad claes.redestad at oracle.com
Wed Apr 18 15:20:52 UTC 2018


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.



More information about the core-libs-dev mailing list