Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-22 Thread Tingjun Yuan
On Tue, 21 Mar 2023 23:41:44 GMT, Claes Redestad wrote: >> Tingjun Yuan has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Set.copyOf: need defensive copy > > If this level of complexity is indeed needed to get whatever improvement >

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-21 Thread Tingjun Yuan
On Tue, 21 Feb 2023 03:39:46 GMT, Tingjun Yuan wrote: >> Currently, the two subclasses of `java.util.EnumSet` optimize bulk >> operations when the argument is also a `EnumSet`, but there is no such >> optimization for wrapper sets (returned by `Collections.unmodifiableSet`, >>

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-21 Thread Claes Redestad
On Tue, 21 Feb 2023 03:39:46 GMT, Tingjun Yuan wrote: >> Currently, the two subclasses of `java.util.EnumSet` optimize bulk >> operations when the argument is also a `EnumSet`, but there is no such >> optimization for wrapper sets (returned by `Collections.unmodifiableSet`, >>

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-21 Thread Chen Liang
On Tue, 21 Feb 2023 03:39:46 GMT, Tingjun Yuan wrote: >> Currently, the two subclasses of `java.util.EnumSet` optimize bulk >> operations when the argument is also a `EnumSet`, but there is no such >> optimization for wrapper sets (returned by `Collections.unmodifiableSet`, >>

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-21 Thread Chen Liang
On Tue, 21 Feb 2023 03:39:46 GMT, Tingjun Yuan wrote: >> Currently, the two subclasses of `java.util.EnumSet` optimize bulk >> operations when the argument is also a `EnumSet`, but there is no such >> optimization for wrapper sets (returned by `Collections.unmodifiableSet`, >>

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-21 Thread Tingjun Yuan
On Tue, 21 Feb 2023 03:39:46 GMT, Tingjun Yuan wrote: >> Currently, the two subclasses of `java.util.EnumSet` optimize bulk >> operations when the argument is also a `EnumSet`, but there is no such >> optimization for wrapper sets (returned by `Collections.unmodifiableSet`, >>

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-21 Thread Pavel Rappo
On Tue, 21 Mar 2023 15:23:53 GMT, Claes Redestad wrote: > An alternative design which would avoid adding more classes could be to add > package-private accessors to the existing `Unmodifiable/Synchronized` wrapper > classes so that `EnumSet/-Map` can retrieve the underlying set of an >

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-21 Thread Claes Redestad
On Tue, 21 Feb 2023 03:39:46 GMT, Tingjun Yuan wrote: >> Currently, the two subclasses of `java.util.EnumSet` optimize bulk >> operations when the argument is also a `EnumSet`, but there is no such >> optimization for wrapper sets (returned by `Collections.unmodifiableSet`, >>

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-03-21 Thread -
Hello Stuart Marks, would you be able to take a look at this patch, improving performance of enum-only immutable collections, as you are the primary engineer in this area? On Mon, Feb 20, 2023 at 9:40 PM Tingjun Yuan wrote: > > > Currently, the two subclasses of `java.util.EnumSet` optimize

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v5]

2023-02-20 Thread Tingjun Yuan
> Currently, the two subclasses of `java.util.EnumSet` optimize bulk operations > when the argument is also a `EnumSet`, but there is no such optimization for > wrapper sets (returned by `Collections.unmodifiableSet`, > `Collections.synchronizedSet`, etc.) and immutable sets (returned by