FrozenBitMap
The major addition of this release is the new class `FrozenBitMap`. It is analogous to the `frozenset` of the standard library: a `FrozenBitMap` is an immutable object that can be hashed.
The main usecase is to use them in sets or dictionnaries:
python
from pyroaring import FrozenBitMap
mydict = {FrozenBitMap() : 'an empty bitmap',
FrozenBitMap([1, 3, 5, 7, 9]) : 'some odd numbers',
FrozenBitMap([1, 2, 4, 8, 16]) : 'powers of two'
}
Optimizations
Several performance optimizations have been implemented :
- Getting a small slice from a large bitmap used to be very long. This is now fixed.
- Two methods `run_optimize()` and `shrink_to_fit()` have been added. They call their CRoaring [counterpart](https://github.com/RoaringBitmap/CRoaring/blob/v0.2.42/include/roaring/roaring.h#L291-L303).
Information
The version number and the git hash of both pyroaring and CRoaring are available from the module:
python
import pyroaring
print(pyroaring.__version__)
print(pyroaring.__git_version__)
print(pyroaring.__croaring_version__)
print(pyroaring.__croaring_git_version__)