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

Improve the Extend::extend implementation for performances #306

Merged
merged 5 commits into from
Jan 7, 2025

Conversation

Kerollmops
Copy link
Member

@Kerollmops Kerollmops commented Dec 9, 2024

Fixes #301.

@Kerollmops Kerollmops changed the title Introduce the RoaringBitmap::insert_many method Introduce the RoaringBitmap::insert_many method Dec 9, 2024
@Kerollmops Kerollmops marked this pull request as ready for review January 7, 2025 14:29
Copy link
Contributor

@irevoire irevoire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code seems right to me. It could execute way quickly if the iterator was sorted, but I guess that can wait until we need it 😅

My only concerns is that, from what I understand, this function is exactly matching the API of the Extend trait.
Shouldn't we implement that trait instead of making our own function?

@Kerollmops Kerollmops changed the title Introduce the RoaringBitmap::insert_many method Improve the Extend::extend implementation for performances Jan 7, 2025
@Kerollmops Kerollmops requested a review from irevoire January 7, 2025 14:55
@Kerollmops
Copy link
Member Author

You are absolutely right that the insert_many method should be replaced by the Extend::extend one. I changed the implementation of the extend method to be the same as the insert_many one and removed the latter.

Thank you 🙏

@Kerollmops Kerollmops mentioned this pull request Jan 7, 2025
Copy link
Contributor

@irevoire irevoire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last smol change and we can merge!

roaring/src/bitmap/iter.rs Outdated Show resolved Hide resolved
roaring/src/bitmap/iter.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@irevoire irevoire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfecto 👌

@Kerollmops Kerollmops merged commit 27743fb into main Jan 7, 2025
17 checks passed
@Kerollmops Kerollmops deleted the insert-many branch January 7, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What's the best way to insert ordered u32s in a RoaringBitmap?
2 participants