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

RFC: Provide selection methods based on internal iteration #164

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

adamreichold
Copy link
Collaborator

@adamreichold adamreichold commented Apr 24, 2024

  • I agree to follow the project's code of conduct.
  • I added an entry to rstar/CHANGELOG.md if knowledge of this change could be valuable to users.

This avoids the overhead of allocating an internal buffer to keep track of upcoming nodes when implementing the Iterator trait.

I also found a mistake in the old code from #37 (lack of early return in the parent case) and now the benchmarks also look somewhat nicer, i.e. directly comparing internal and external iteration on the same data set:

locate_at_point (successful)
                        time:   [115.62 ns 116.51 ns 117.43 ns]

locate_at_point_int (successful)
                        time:   [66.831 ns 67.264 ns 67.653 ns]

locate_at_point (unsuccessful)
                        time:   [167.70 ns 168.03 ns 168.34 ns]

locate_at_point_int (unsuccessful)
                        time:   [167.90 ns 168.28 ns 168.64 ns]

Closes #163

This avoids the overhead of allocating an internal buffer to keep
track of upcoming nodes when implementing the `Iterator` trait.
@rmanoka
Copy link
Contributor

rmanoka commented Apr 25, 2024

I'm for having this recursive impl. as an alternative to the iterator approach.

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.

Avoiding SmallVec in SelectionIterator
2 participants