Skip to content
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

ImmutableRoaringBitmap #124

Open
saik0 opened this issue Dec 28, 2021 · 3 comments
Open

ImmutableRoaringBitmap #124

saik0 opened this issue Dec 28, 2021 · 3 comments

Comments

@saik0
Copy link
Contributor

saik0 commented Dec 28, 2021

The java impl contains a ReadOnlyRoaringBitmap that can be backed by a byte buffer. Is there any interest in including a Roaring bitmap that's backed by a borrowed byte slice whose contents are the serialized format? This could be useful for zero-copy deserialization or memory mapped use cases.

@saik0 saik0 changed the title ImmutablerRoaringBitmap ImmutableRoaringBitmap Dec 28, 2021
@Kerollmops
Copy link
Member

Kerollmops commented Jan 3, 2022

Thank you for your issue. I have done some research related to this area that you can read in the issue RoaringBitmap/RoaringFormatSpec#9. I don't know if we want to introduce a new type that is able to deserialize from a byte slice &[u8] and only point to serialized bytes, a lazy type that can deserialize its parts on demand.

@lemire
Copy link
Member

lemire commented Jan 3, 2022

There is a 'frozen format' supported by the C and Go versions. It is like the normal serialized format, but it adds some alignment so that you can just reinterpret the bytes without undefined behaviour (in C/C++).

@josephglanville
Copy link
Contributor

Here is the specification for the frozen format: https://github.com/RoaringBitmap/CRoaring/blob/99f31771e1a372a1ac54abcf4fd3349db35cadf4/src/roaring.c#L2754-L2781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants