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

Introduce insert_range for RoaringTreemap #222

Merged
merged 11 commits into from
Sep 1, 2022

Conversation

not-jan
Copy link
Contributor

@not-jan not-jan commented Jun 26, 2022

Implemented a somewhat naive version of insert_range for RoaringTreemap

I wanted to add a separate benchmark to compare the performance of insert_range with collecting from an iterator but was unable to do so because cargo bench would fail with a connection error every time I ran it.
Edit: This is fixed now with #225

@Kerollmops
Copy link
Member

Kerollmops commented Jun 28, 2022

Hey @not-jan,

Thank you very much for your work, I appreciate the RoaringTreemap::insert_range method, however, I would prefer that we don't remove the retain_mut dependency right now as I described in #224. Would it be possible to remove this commit from your PR (and description), please?

About the benchmark issue, I think GitHub broke URLs like git://github.com/orga/repo.git. I don't know why it was working before but I just made #225 that you can rebase on. Sorry for the inconvenience. If it works correctly you should be able to add a benchmark 😃 (you must cd benchmarks first and cargo bench).

@Kerollmops Kerollmops self-requested a review June 28, 2022 09:40
@not-jan not-jan changed the title Update to the latest stable Rust and introduce insert_range for RoaringTreemap Introduce insert_range for RoaringTreemap Jun 28, 2022
@not-jan
Copy link
Contributor Author

not-jan commented Jun 28, 2022

Thank you for the quick response :)

I've performed the requested changes and added my benchmark. I'm not sure whether my benchmark is that effective, since I've copied it from the implementation for the RoaringBitmap. Any opinions about that?

Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

Thank you for the changes!

Would it be possible to rebase again but on master now that I merged my PR, please? This way my commits will not be visible in your PR.

@@ -650,6 +651,30 @@ fn insert_range_bitmap(c: &mut Criterion) {
}
}

fn insert_range_treemap(c: &mut Criterion) {
for &size in &[10, 100, 1_000, 5_000, 10_000, 20_000] {
Copy link
Member

Choose a reason for hiding this comment

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

Could we add bigger values here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added 2 * (2^32 -1) now to ensure that we're crossing a bitmap boundary. Is there any point in adding an additional benchmark that compares the new insert_range to (0..size).collect<RoaringTreemap>()? Gut feeling says it's gonna be awfully slow with the current implementation.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can add two benchmarks indeed, this way we must be able to improve that in the future. That cool be good indeed!

benchmarks/benches/lib.rs Show resolved Hide resolved
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

Hey @not-jan,
Thank you for the time you put into this PR, I would like to do a release of roaring-rs soon. I will merge your work as is and we could improve it in future PRs.

I'll try to merge it with bors but there are merge conflicts so we'll see. If it doesn't pass, could you please rebase on main (yes main, I changed the name), please?

bors merge

@bors
Copy link
Contributor

bors bot commented Aug 31, 2022

Merge conflict.

@not-jan
Copy link
Contributor Author

not-jan commented Aug 31, 2022

Should be all done :)

Copy link
Member

@Kerollmops Kerollmops left a 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! Could you please remove the .idea folder?

@not-jan not-jan force-pushed the master branch 2 times, most recently from 16f4896 to f293c8b Compare August 31, 2022 23:24
@not-jan
Copy link
Contributor Author

not-jan commented Aug 31, 2022

Thank you very much! Could you please remove the .idea folder?

I think I erased it from the commit history succesfully but I seem to have accidentally included 9d9b807 in my rebase. I can't seem to undo that though as my reflog refuses to return to a state before the rebase started :/

@Kerollmops Kerollmops changed the base branch from main to tmp-insert-range September 1, 2022 08:34
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

I'll merge into another branch and try to fix that 😃
bors merge

bors bot added a commit that referenced this pull request Sep 1, 2022
222: Introduce `insert_range` for RoaringTreemap r=Kerollmops a=not-jan

Implemented a somewhat naive version of `insert_range` for RoaringTreemap

~~I wanted to add a separate benchmark to compare the performance of `insert_range` with collecting from an iterator but was unable to do so because `cargo bench` would fail with a connection error every time I ran it.~~
**Edit:** This is fixed now with #225

Co-authored-by: saik0 <[email protected]>
Co-authored-by: not-jan <[email protected]>
@bors
Copy link
Contributor

bors bot commented Sep 1, 2022

Build failed:

@Kerollmops Kerollmops merged commit f203769 into RoaringBitmap:tmp-insert-range Sep 1, 2022
bors bot added a commit that referenced this pull request Sep 1, 2022
240: Introduce `insert_range` for the `Treemap` r=Kerollmops a=Kerollmops

This is a follow-up of #222, I cleaned it up before merging it into the main branch.

Co-authored-by: not-jan <[email protected]>
Co-authored-by: Clément Renault <[email protected]>
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.

3 participants