-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/tools/containers/intsets: use the Sparse root block #21311
Comments
I can try to find some time to take a stab at this if folks agree it's a good idea. |
Please do; it would certainly be a worthwhile optimization. I tried this at some point in the past but the logic got rather messy so I abandoned it. |
what about bitsets, a high performance pkg. |
Change https://golang.org/cl/53431 mentions this issue: |
@dongweigogo - the usecase is different: |
Sparse
has a root block but that block doesn't store any element information. So even very small sets (e.g. single element) will need to allocate another block on the heap. So (on a 64-bit arch) we have 56 bytes in the structure and another 56 bytes on the heap, just to represent a single value.There is no reason to not use the root block itself to store bits. It could be always the block with the smallest offset.
The text was updated successfully, but these errors were encountered: