Merge #5221
Some checks failed
Test suite / Tests on ${{ matrix.os }} (macos-13) (push) Waiting to run
Test suite / Tests on ${{ matrix.os }} (windows-2022) (push) Failing after 1m4s
Test suite / Tests on ubuntu-20.04 (push) Failing after 27s
Test suite / Tests almost all features (push) Has been skipped
Test suite / Test disabled tokenization (push) Has been skipped
Test suite / Run tests in debug (push) Failing after 20s
Test suite / Run Clippy (push) Successful in 8m45s
Test suite / Run Rustfmt (push) Successful in 2m31s

5221: Merge bitmaps by using `Extend::extend` r=Kerollmops a=Kerollmops

This PR tries to speed up the merging of bitmaps by using [the new `Extend::extend` implementation](https://github.com/RoaringBitmap/roaring-rs/pull/306).

Co-authored-by: Clément Renault <clement@meilisearch.com>
This commit is contained in:
meili-bors[bot] 2025-01-13 13:43:28 +00:00 committed by GitHub
commit 247eaed872
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -679,9 +679,7 @@ impl DelAddRoaringBitmap {
let del = self.del.get_or_insert_with(RoaringBitmap::new); let del = self.del.get_or_insert_with(RoaringBitmap::new);
let mut iter = bbbul.iter_and_clear(); let mut iter = bbbul.iter_and_clear();
while let Some(block) = iter.next_block() { while let Some(block) = iter.next_block() {
let iter = block.iter().copied(); del.extend(block);
let block = RoaringBitmap::from_sorted_iter(iter).unwrap();
*del |= block;
} }
} }
@ -689,9 +687,7 @@ impl DelAddRoaringBitmap {
let add = self.add.get_or_insert_with(RoaringBitmap::new); let add = self.add.get_or_insert_with(RoaringBitmap::new);
let mut iter = bbbul.iter_and_clear(); let mut iter = bbbul.iter_and_clear();
while let Some(block) = iter.next_block() { while let Some(block) = iter.next_block() {
let iter = block.iter().copied(); add.extend(block);
let block = RoaringBitmap::from_sorted_iter(iter).unwrap();
*add |= block;
} }
} }
} }