mavam / libbf

:dart: Bloom filters for C++11
http://mavam.github.io/libbf
BSD 3-Clause "New" or "Revised" License
354 stars 89 forks source link

error about the largest size of entity added into bf #8

Closed xuzhw closed 10 years ago

xuzhw commented 10 years ago

Hi Matthias, when I use libbf in my own program about name lookup, I get a error about the largest size of entity added into bf.

terminate called after throwing an instance of 'std::runtime_error' what(): object too large Aborted (core dumped)

I checked my code, the reason for this error is about the size of entity(the length of the string) added into bf, when adding a long name(URI) into bf, this error will come up. How large entity can I add into bf here? How can I solve this problem? Any advice? Thanks.

xuzhw commented 10 years ago

Well, I have found the param relevant to the max size of the entity in hash.h, there is no problem now. Thanks anyway.

mavam commented 10 years ago

The problem you are encountering has to do with the maximum support object size. In libbf, an "object" is just type-erased structure for sequential data. The problem is that I have not yet explored how well the used hash function family performs for objects larger than the maximum size. I cannot give guarantees that they remain pairwise independent and and keep performing within the theoretical bounds. Please consider the change you made if you come across any unexpected behavior, for example when your expected false-positive rate deviates from the implementation.