Re: RFR: 8315454: Add an immutable BitSet

2023-09-02 Thread John Rose
On 1 Sep 2023, at 2:38, Maurizio Cimadamore wrote: > On Fri, 1 Sep 2023 09:07:34 GMT, Per Minborg wrote: > >>> Maybe it would make sense to start with a JDK-internal variant before >>> exploring potential public API? >> >> This is certainly one alternative. > > When looking at this I thought abo

Re: RFR: 8315454: Add an immutable BitSet [v2]

2023-09-01 Thread Per Minborg
> This PR proposes adding a new method to BitSet that provides an immutable > snapshot of the set in the form of an `IntPredicate`. > > The predicate is eligible for constant folding. > > Here are some classes in the JDK that would benefit directly from > constant-folding of BitSets: > > PoolR

Re: RFR: 8315454: Add an immutable BitSet

2023-09-01 Thread Claes Redestad
On Fri, 1 Sep 2023 08:21:13 GMT, Per Minborg wrote: > This PR proposes adding a new method to BitSet that provides an immutable > snapshot of the set in the form of an `IntPredicate`. > > The predicate is eligible for constant folding. > > Here are some classes in the JDK that would benefit di

Re: RFR: 8315454: Add an immutable BitSet

2023-09-01 Thread Viktor Klang
On Fri, 1 Sep 2023 08:21:13 GMT, Per Minborg wrote: > This PR proposes adding a new method to BitSet that provides an immutable > snapshot of the set in the form of an `IntPredicate`. > > The predicate is eligible for constant folding. > > Here are some classes in the JDK that would benefit di

Re: RFR: 8315454: Add an immutable BitSet

2023-09-01 Thread Maurizio Cimadamore
On Fri, 1 Sep 2023 09:07:34 GMT, Per Minborg wrote: > > Maybe it would make sense to start with a JDK-internal variant before > > exploring potential public API? > > This is certainly one alternative. When looking at this I thought about that too. It seems like the particular case where this

Re: RFR: 8315454: Add an immutable BitSet

2023-09-01 Thread Per Minborg
On Fri, 1 Sep 2023 09:00:32 GMT, Hannes Greule wrote: > Maybe it would make sense to start with a JDK-internal variant before > exploring potential public API? This is certainly one alternative. - PR Comment: https://git.openjdk.org/jdk/pull/15530#issuecomment-1702421871

Re: RFR: 8315454: Add an immutable BitSet

2023-09-01 Thread Per Minborg
On Fri, 1 Sep 2023 08:50:42 GMT, Chen Liang wrote: > What about the missing functionalities, such as ranged get, cardinality, > next/previousSet/ClearBit? This was explored in https://github.com/openjdk/jdk/pull/15493 - PR Comment: https://git.openjdk.org/jdk/pull/15530#issuecomme

Re: RFR: 8315454: Add an immutable BitSet

2023-09-01 Thread Hannes Greule
On Fri, 1 Sep 2023 08:21:13 GMT, Per Minborg wrote: > This PR proposes adding a new method to BitSet that provides an immutable > snapshot of the set in the form of an `IntPredicate`. > > The predicate is eligible for constant folding. > > Here are some classes in the JDK that would benefit di

Re: RFR: 8315454: Add an immutable BitSet

2023-09-01 Thread Chen Liang
On Fri, 1 Sep 2023 08:21:13 GMT, Per Minborg wrote: > This PR proposes adding a new method to BitSet that provides an immutable > snapshot of the set in the form of an `IntPredicate`. > > The predicate is eligible for constant folding. > > Here are some classes in the JDK that would benefit di

RFR: 8315454: Add an immutable BitSet

2023-09-01 Thread Per Minborg
This PR proposes adding a new method to BitSet that provides an immutable snapshot of the set in the form of an `IntPredicate`. The predicate is eligible for constant folding. Here are some classes in the JDK that would benefit directly from constant-folding of BitSets: PoolReader (6) URLEncod