RFR: 8300487: Store cardinality as a field in BitSet [v7]
fabioromano1
duke at openjdk.org
Sun Jan 22 13:09:37 UTC 2023
> 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.
fabioromano1 has updated the pull request incrementally with one additional commit since the last revision:
Added tests for NaturalsBitSet class
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/11837/files
- new: https://git.openjdk.org/jdk/pull/11837/files/0c3e7cdf..9d9fb06c
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=11837&range=06
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=11837&range=05-06
Stats: 1549 lines in 10 files changed: 1438 ins; 57 del; 54 mod
Patch: https://git.openjdk.org/jdk/pull/11837.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/11837/head:pull/11837
PR: https://git.openjdk.org/jdk/pull/11837
More information about the core-libs-dev
mailing list