-
Notifications
You must be signed in to change notification settings - Fork 68
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
Bulk Load via Iterator #174
Comments
I have not tried recently, but I do not think this is straight forward as we use `Vec::split_off´ internally to divide the workload for recursion. |
Agreed, there is not a good way around collecting into a That being said, I think this does make sense from ergonomics side and should be easy to add. |
Without some specialization, where we know the I do agree that it's more ergonomic, but we need a caveat explaining it'll double-allocate if used on a large iterator. |
This would be nice purely for ergonomics, whether or not the elements are ultimately collected into a vec internally. Poking around the source however, it does look like the bulk load might be able to avoid such intermediate collection. Either way is a win.
Bonus easy sub-trees:
I understand the sub-trees can also be created by using
drain_with_selection_function
, but that requires setting up aSelectionFunction
, possibly cloning the original tree, and discarding the drained items. I'm not actually sure which method would be most performant.The text was updated successfully, but these errors were encountered: