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

include update() method to take an array of values #13

Closed
brentp opened this issue Sep 8, 2016 · 4 comments
Closed

include update() method to take an array of values #13

brentp opened this issue Sep 8, 2016 · 4 comments

Comments

@brentp
Copy link

brentp commented Sep 8, 2016

with ctypes, adding a single element at a time (when it's not feasible to send an array to the constructor) is slow. Would be nice to have an update() method that would have only a single ctypes call.

@brentp
Copy link
Author

brentp commented Sep 8, 2016

I got around this by just using bm |= Bitmap(new_values) which seems pretty fast.
So feel free to close this issue, though I think having an update() to match the set interface would be nice.

@Ezibenroc
Copy link
Owner

Good point, I also think that we should match the set interface.

CRoaring does not have yet an update function, so we are currently forced to use the bm |= Bitmap(new_values) that you suggest. It is several order of magnitude faster than calling add for each value when there are thousands of values. However, it is not the best we can do, since instanciating a new bitmap has certainly a non negligible overhead.

I have created an issue in CRoaring: RoaringBitmap/CRoaring#54

@lemire
Copy link
Contributor

lemire commented Sep 9, 2016

Version 0.2.3 has a function with the following signature...

void roaring_bitmap_add_many(roaring_bitmap_t * r, size_t n_args, const uint32_t *vals);

which could be handy.

@Ezibenroc
Copy link
Owner

Thank you @lemire.
update() method added in b58749d

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

3 participants