-
Notifications
You must be signed in to change notification settings - Fork 83
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
Make append O(N) #132
Make append O(N) #132
Conversation
Mistakenly opened this as a PR, rather than a draft. Treemap append needs tests that spans across bitmaps |
Fixed that for you 😄 (top right, just below the reviewers). |
I don't believe I can change that as a non-member |
I just checked on a non-owned repo and yes you can, it is just that the link is not present as it is now a Draft, but I am pretty sure you can 😃 |
These methods are not The
What would you think about adding some |
Also it's |
Ok, it seems like you are right, for dangerous internal functions we can keep them safe. Use this comment for #127 too, don't declare them as |
I've added debug assertions and clear docs about the validity guarantees. |
Co-authored-by: Clément Renault <[email protected]>
Co-authored-by: Clément Renault <[email protected]>
Co-authored-by: Clément Renault <[email protected]>
Co-authored-by: Clément Renault <[email protected]>
Co-authored-by: Clément Renault <[email protected]>
Co-authored-by: Clément Renault <[email protected]>
Co-authored-by: Clément Renault <[email protected]>
c27b74a
to
8b20334
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your work!
bors merge
Build succeeded: |
132: Make append O(N) r=Kerollmops a=saik0 Continuation on RoaringBitmap#131 ## Summary * Append is currently O(N logN) as it must binary search through containers on each insert. Inserting into an array container is also logN. * This converts append operation to O(N) by adding a crate public `push_unchecked` methods that should only be called once it's been verified that the value >= max. Eliminating both of the logN lookups ## Before ![Screen Shot 2022-01-09 at 11 13 35 PM](https://user-images.githubusercontent.com/997050/148779927-fc095082-0f22-4fdd-b7b8-dc73b333359f.png) ## After ![Screen Shot 2022-01-10 at 4 40 30 AM](https://user-images.githubusercontent.com/997050/148779952-782b9ce9-22c5-4a01-933d-7e858da3d668.png) Co-authored-by: saik0 <[email protected]> Co-authored-by: Joel Pedraza <[email protected]>
Continuation on #131
Summary
push_unchecked
methods that should only be called once it's been verified that the value >= max. Eliminating both of the logN lookupsBefore
After