prashnts / pybloomfiltermmap3

Fast Python Bloom Filter using Mmap
https://github.com/prashnts/pybloomfiltermmap3
MIT License
130 stars 24 forks source link

__len__(bf) misreports after open(filename) #28

Open mizvyt opened 4 years ago

mizvyt commented 4 years ago

Issue in detail here: https://github.com/axiak/pybloomfiltermmap/issues/31

A fix is referenced, but I'd like to still think over the options.

prashnts commented 4 years ago

this, #38, #31 might all be linked. I'll take a look.

prashnts commented 4 years ago

I was able to reproduce this finally, and noticed this stays even after #40. (Using bf.approx_len gets us correct length...) but need to dig deeper.

I reckon the problem might be around self._bf.count_correct and self._bf.elem_count in the cython class.

Which begs the question: why not use approx_len all the time?

prashnts commented 4 years ago

For reference, this is the patch:

https://github.com/axiak/pybloomfiltermmap/pull/47/files#diff-a16b2c8dba66561e6fdef61b6efe2b04

nffdiogosilva commented 3 years ago

Can you not merge that patch into your repository and that publish the updated version to the pypi?