Hello, when shuffling the CopyOnWrite list with the standard
Collections.shuffle method, performance anomalies occur, due to the fact
that it calls the set method, which copies the array each time, a possible
solution (crutch) is a random comparator for sorting, so sorting in COW is
redefined to its own sub - blocking implementation

Another problem with Collections.shuffle is that it's not exactly thread
safe because it calls the size() method; and then iterates from it, also
COW does not support modification inside the iterator (works on snapshots)


COWCollectionsShuffle      0,008 ops/ms
COWListRandomSort         1,089 ops/ms
syncListCollectionsShuffle  0,950 ops/ms

Reply via email to