Description
The ListSampler shuffle algorithm uses the input list set(index) method. If this runs in constant time then the algorithm is fast. If the list is not an instance of java.util.RandomAccess such as a LinkedList the algorithm will suffer from performance slowdown for large lists.
This is handled in the JDK Collections.shuffle method by detecting if the list is not an instance of RandomAccess. If so the list set(index) method is avoided and the list is traversed for update using its iterator.
Tasks:
- Benchmark the ListSampler method verses Collections.shuffle with ArrayList and LinkedList
- Update the ListSampler to have comparable performance to Collections.shuffle
Attachments
Issue Links
- links to