Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
131: Append perf bugfix r=Kerollmops a=saik0 Fixes #130 ## Cause Where _N_ is the length of the iterator: _N_ calls to `RoaringBitmap::push` required N calls to`RoaringBitmap::max`, which is not cheap. ## Solution Compare only the first item in the iterator to the bitmap max, then compare each element to its predecessor. ## Future work This could be strictly faster than inserting, given that it's always inserting into the last container (or pushing a new container) ## Before ![Screen Shot 2022-01-09 at 9 35 20 PM](https://user-images.githubusercontent.com/997050/148730686-152f7232-4ef0-43da-b37f-7bef6d1502da.png) ![Screen Shot 2022-01-09 at 9 35 36 PM](https://user-images.githubusercontent.com/997050/148730691-a15045a7-0abc-47c3-8208-b95aa406a681.png) ## After ![Screen Shot 2022-01-09 at 11 13 35 PM](https://user-images.githubusercontent.com/997050/148729666-55c48265-d38a-4865-a92d-ceb83efdb500.png) ![Screen Shot 2022-01-09 at 11 13 43 PM](https://user-images.githubusercontent.com/997050/148729673-41dfc7e1-62ca-4cc4-8c7c-8cd3b59adc4c.png) Co-authored-by: saik0 <[email protected]>
- Loading branch information