Withdrawn: 8300487: Store cardinality as a field in BitSet

fabioromano1 duke at openjdk.org
Sun Jan 22 13:09:37 UTC 2023


On Tue, 3 Jan 2023 23:25:39 GMT, fabioromano1 <duke at openjdk.org> 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 words in use by the bit set.
> This optimization reduces the cost of calling cardinality() to constant time, as it simply returns the value of the field, and it also try to make as little effort as possible to update the field, when needed.

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/jdk/pull/11837


More information about the core-libs-dev mailing list