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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve RoaringBitmap ref with ref set operations #102

Merged
merged 7 commits into from Jun 2, 2021
Merged

Conversation

Kerollmops
Copy link
Member

@Kerollmops Kerollmops commented May 1, 2021

This is a follow-up of the #97 PR. It improves the specific &RoaringBitmap with &RoaringBitmap union, intersection difference and, symmetric difference operations.

The previous implementation was cloning the smallest or biggest bitmap depending on the operation and applying an _assign operation on it, this was not quite efficient. In this new implementation, we no more clone the containers Vec but rather collect the required Containers from the left-hand side or the right-hand side.

The performance gain is around 20% 馃帀 馃殌

Capture d鈥檈虂cran 2021-06-02 a虁 15 08 02

Capture d鈥檈虂cran 2021-06-02 a虁 15 08 13

@Kerollmops
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request May 1, 2021
@bors
Copy link
Contributor

bors bot commented May 1, 2021

try

Build succeeded:

@Kerollmops
Copy link
Member Author

Hey @MarinPostma, if you got time, could you take a look at this PR, please? 馃槂

@Kerollmops Kerollmops changed the title Improve RoaringBimtap ref with ref set operations Improve RoaringBitmap ref with ref set operations May 1, 2021
@Kerollmops Kerollmops force-pushed the improve-ref-ref-ops branch 4 times, most recently from c61c727 to db90b25 Compare May 1, 2021 15:08
src/bitmap/ops.rs Outdated Show resolved Hide resolved
@Kerollmops Kerollmops force-pushed the improve-ref-ref-ops branch 2 times, most recently from b25ade8 to b5738cf Compare May 25, 2021 12:16
src/bitmap/store.rs Outdated Show resolved Hide resolved
src/bitmap/store.rs Outdated Show resolved Hide resolved
src/bitmap/store.rs Outdated Show resolved Hide resolved
@Kerollmops Kerollmops force-pushed the improve-ref-ref-ops branch 2 times, most recently from f41f311 to 89e9750 Compare June 1, 2021 09:45
@Kerollmops
Copy link
Member Author

bors merge

bors bot added a commit that referenced this pull request Jun 1, 2021
102: Improve RoaringBitmap ref with ref set operations r=Kerollmops a=Kerollmops

This is a follow-up of the #97 PR. It improves the specific `&RoaringBitmap` with `&RoaringBitmap` `union`, `intersection` `difference` and, `symmetric difference` operations.

The previous implementation was cloning the smallest or biggest bitmap depending on the operation and applying an `_assign` operation on it, this was not quite efficient. In this new implementation, we no more clone the containers `Vec` but rather collect the required `Container`s from the left-hand side or the right-hand side.

The performance gain is around 20% 馃帀 馃殌

Co-authored-by: Cl茅ment Renault <clement@meilisearch.com>
Co-authored-by: Kerollmops <clement@meilisearch.com>
@bors
Copy link
Contributor

bors bot commented Jun 1, 2021

Build failed:

@Kerollmops
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Jun 1, 2021
@bors
Copy link
Contributor

bors bot commented Jun 1, 2021

try

Build succeeded:

@Kerollmops
Copy link
Member Author

I will first introduce the Pairs iterator described in #111 to make this PR less ugly.

@Kerollmops Kerollmops force-pushed the improve-ref-ref-ops branch 2 times, most recently from d27d026 to b8556b2 Compare June 2, 2021 10:02
@Kerollmops
Copy link
Member Author

bors merge

bors bot added a commit that referenced this pull request Jun 2, 2021
102: Improve RoaringBitmap ref with ref set operations r=Kerollmops a=Kerollmops

This is a follow-up of the #97 PR. It improves the specific `&RoaringBitmap` with `&RoaringBitmap` `union`, `intersection` `difference` and, `symmetric difference` operations.

The previous implementation was cloning the smallest or biggest bitmap depending on the operation and applying an `_assign` operation on it, this was not quite efficient. In this new implementation, we no more clone the containers `Vec` but rather collect the required `Container`s from the left-hand side or the right-hand side.

The performance gain is around 20% 馃帀 馃殌

<img width="975" alt="Capture d鈥檈虂cran 2021-06-02 a虁 15 08 02" src="https://user-images.githubusercontent.com/3610253/120485432-5f940d80-c3b4-11eb-907c-01a35b0e2ad2.png">
<img width="959" alt="Capture d鈥檈虂cran 2021-06-02 a虁 15 08 13" src="https://user-images.githubusercontent.com/3610253/120485586-8baf8e80-c3b4-11eb-84bb-33f428f34329.png">

Co-authored-by: Cl茅ment Renault <clement@meilisearch.com>
Co-authored-by: Kerollmops <clement@meilisearch.com>
@bors
Copy link
Contributor

bors bot commented Jun 2, 2021

Build failed:

@Kerollmops
Copy link
Member Author

bors merge

@bors
Copy link
Contributor

bors bot commented Jun 2, 2021

Build succeeded:

@bors bors bot merged commit 7941c31 into master Jun 2, 2021
@bors bors bot deleted the improve-ref-ref-ops branch June 2, 2021 13:19
not-jan pushed a commit to not-jan/roaring-rs that referenced this pull request Aug 31, 2022
102: Improve RoaringBitmap ref with ref set operations r=Kerollmops a=Kerollmops

This is a follow-up of the RoaringBitmap#97 PR. It improves the specific `&RoaringBitmap` with `&RoaringBitmap` `union`, `intersection` `difference` and, `symmetric difference` operations.

The previous implementation was cloning the smallest or biggest bitmap depending on the operation and applying an `_assign` operation on it, this was not quite efficient. In this new implementation, we no more clone the containers `Vec` but rather collect the required `Container`s from the left-hand side or the right-hand side.

The performance gain is around 20% 馃帀 馃殌

<img width="975" alt="Capture d鈥檈虂cran 2021-06-02 a虁 15 08 02" src="https://user-images.githubusercontent.com/3610253/120485432-5f940d80-c3b4-11eb-907c-01a35b0e2ad2.png">
<img width="959" alt="Capture d鈥檈虂cran 2021-06-02 a虁 15 08 13" src="https://user-images.githubusercontent.com/3610253/120485586-8baf8e80-c3b4-11eb-84bb-33f428f34329.png">

Co-authored-by: Cl茅ment Renault <clement@meilisearch.com>
Co-authored-by: Kerollmops <clement@meilisearch.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants