Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Boiarshinov opened this issue Jun 2, 2022 · 1 comment
Closed

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

Boiarshinov opened this issue Jun 2, 2022 · 1 comment

Comments

@Boiarshinov
Copy link
Contributor

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.

@Boiarshinov
Copy link
Contributor Author

I have prepared Pull Request with such improvement: #3115

@siriak siriak closed this as completed Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants