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

Optimize the iterators and release 0.1.1 #5

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Jan 30, 2025

Overriding fold helps a lot because this is similar to a chain, where we can reduce branches by folding all on one part and then the other.

We can also improve next and next_back by moving exhausted inner iterators out of the way.

These benefit from internal iteration over just the head and then the
tail, or vice versa. The `iter_sum_ringmap_10_000` benchmark is about
twice as fast with this change!
This is similar to what `VecDeque` does in its iterators.
@cuviper cuviper changed the title Optimize the iterators Optimize the iterators and release 0.1.1 Jan 30, 2025
@cuviper cuviper enabled auto-merge January 30, 2025 00:06
@cuviper cuviper added this pull request to the merge queue Jan 30, 2025
Merged via the queue into indexmap-rs:main with commit 6b9915e Jan 30, 2025
15 checks passed
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.

1 participant