-
Notifications
You must be signed in to change notification settings - Fork 30
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
How to use this most efficiently? #45
Comments
Hi |
Hi, Personally i'd argue that using a bitset most often implies one is going for memory efficiency above performance. I do have a usecase where this really matters though it's very much niche. This brings down data usage per 0.5 seconds to ~300 bytes. Now if i have a bitset that tells me which entries changed then i only need to send:
So yeah, this very niche case, does in fact save quite a bit of data if it were possible with BitSet. |
So, a very quick experiment with https://github.com/Callidon/bloom-filters/blob/master/src/bloom/bit-set.ts (from the bloom-filters package, the bitset is just for internal purposes). That is memory efficient and it does in fact turn out that using such a structure gives me 0.5 second data blobs between 40-100 bytes. The API of that class is weird though... Oh well, works for my needs. Could you perhaps consider adding a settable flag to your class to choose between memory efficiency and performance? |
Hi,
I want to store 214 bits in a BitSet.
When i do that it's data array is 10 elements. That's 10x 32bit int (320 bit).
Ideally it would use the bare minimum in bit overhead. If that were to be done in 32 bit ints then 7 ints (224 bit) would suffice.
More ideal would be an array of chars (8 bit each) where i'd need 27 chars giving me 216 bits of room.
Are there arguments i can set in this class to get that more ideal behavior (ints or chars, both work)?
The text was updated successfully, but these errors were encountered: