Re: CopyOnWriteArrayList Collection.shuffle

2022-08-29 Thread Zelva Lia
a non-random access list. > > Jason > > ____ > From: core-libs-dev on behalf of Zelva > Lia > Sent: Friday, August 19, 2022 5:49 AM > To: core-libs-dev@openjdk.org > Subject: CopyOnWriteArrayList Collection.shuffle > > Hello, whe

Re: CopyOnWriteArrayList Collection.shuffle

2022-08-24 Thread Jason Mehrens
have the same problem. Jason From: Zelva Lia Sent: Wednesday, August 24, 2022 5:46 PM To: Jason Mehrens Cc: core-libs-dev@openjdk.org Subject: Re: CopyOnWriteArrayList Collection.shuffle Well, yes, this is a solvable problem, albeit with additional copying,

Re: CopyOnWriteArrayList Collection.shuffle

2022-08-24 Thread Jason Mehrens
ng List::replaceAll you could then just wrap CopyOnWriteArrayList in a non-random access list. Jason From: core-libs-dev on behalf of Zelva Lia Sent: Friday, August 19, 2022 5:49 AM To: core-libs-dev@openjdk.org Subject: CopyOnWriteArrayList Collec

CopyOnWriteArrayList Collection.shuffle

2022-08-23 Thread Zelva Lia
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 it