Skip to content

Reduce memory cost for Bloom Filter up to ~32 times #3114

@Boiarshinov

Description

@Boiarshinov

In current realisation of Bloom Filter there is a int value for every array item.

private int [] bitArray;

But the only possible values for that items is 1 or 0, so it would be better to use bit array instead of int array.
There is no bit primitive in Java. boolean values have size of 8 bits so it would be too expensive for our case too. But there is a special collection in standard Java library which can be used as a bit array - BitSet.
BitSet store bits in a long array where every long value used as a container for the next 64 bits.
So it would much more effective for memory usage to use BitSet instead of int array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions