-
Notifications
You must be signed in to change notification settings - Fork 84
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
Implement Hash #231
Comments
I tried benchmarking this vs |
I don't think it can be derived automatically - identical RoaringBitmaps with different representations (array vs bitmap) should have the same hash. |
@RaduBerinde Good point! I somehow hadn't thought of that. It happens to be working as far as I can tell, although that could be just by chance. |
It's possible there is currently only one possible choice, depending on the cardinality (we call "ensure correct store" after each op). But maybe that will change in the future (I actually found this surprising, as it invites some annoying cornercases, like repeatedly adding and removing an element when cardinality is at the cutoff). |
One simple way for a good enough I understand the performance concern but I just wanted to notice that.
Not sure about the performance, also it can only be called, as you said, after an op, as the bitmap must be mutable. |
My $0.02: Java, C and Go allow two equivalent bitmaps to have mismatched hashes if one contains run containers and the other doesn't, so from a consistency and speed (now you can operate on bytes plain and simple!) point of view it's still an option here. |
Would it be possible to implement the
Hash
trait forRoaringBitmap
? It looks like this can be derived automatically (viaArrayStore
/BitmapStore
,Store
, andContainer
). Alternatively, perhaps something like the hash function in pyroaring would be more suitable?The text was updated successfully, but these errors were encountered: