Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-20 Thread fabioromano1
On Thu, 19 Jan 2023 23:14:12 GMT, John R Rose wrote: > I'll pile on: This optimization doesn't buy much in today's world, where most > machines execute `bitCount` in one cycle. It saves a trivial loop. Over very > large bitsets that saves something, but most bitsets are likely to be medium >

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread John R Rose
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread Martin Buchholz
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread fabioromano1
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread Martin Buchholz
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread fabioromano1
On Thu, 19 Jan 2023 14:03:38 GMT, fabioromano1 wrote: > Libraries cannot be all things to all users. A library provides a service > that would be difficult for a majority of users to implement on their own. > Sometimes a library needs specialization for certain use cases. That is why > we use

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread fabioromano1
On Thu, 19 Jan 2023 13:24:03 GMT, Jim Laskey wrote: > Libraries cannot be all things to all users. A library provides a service > that would be difficult for a majority of users to implement on their own. > Sometimes a library needs specialization for certain use cases. That is why > we use

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread Jim Laskey
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-19 Thread fabioromano1
On Wed, 18 Jan 2023 21:51:02 GMT, Martin Buchholz wrote: > Like other reviewers, changing the performance tradeoffs in BitSet make me > uncomfortable. > > 30 years of code has adapted to the current performance tradeoffs. Those > users who really need O(1) cardinality() can fairly easily

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-18 Thread Martin Buchholz
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-18 Thread fabioromano1
On Wed, 18 Jan 2023 14:15:17 GMT, Uwe Schindler wrote: > As one dealing with bitsets very often: In my opinion, adding this to bitset > adds too much overhead on the hot methods like set/clear methods. Especially > loops that populate a BitSet with values, I am not sure if the whole loop can

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-18 Thread Uwe Schindler
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-18 Thread Uwe Schindler
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-18 Thread Claes Redestad
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-18 Thread Jim Laskey
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-18 Thread Alan Bateman
On Wed, 18 Jan 2023 12:43:31 GMT, fabioromano1 wrote: >> The enanchment is useful for applications that make heavy use of BitSet >> objects as sets of integers, and therefore they need to make a lot of calls >> to cardinality() method, which actually require linear time in the number of >>

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-18 Thread fabioromano1
> The enanchment is useful for applications that make heavy use of BitSet > objects as sets of integers, and therefore they need to make a lot of calls > to cardinality() method, which actually require linear time in the number of > words in use by the bit set. > This optimization reduces the