-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
implement advance_(back_)_by on more iterators #87091
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
@timvermeulen I changed the API contract of a bit. Do they look ok to you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a couple of comments, let me know what you think about them
Thanks for the reviews @pickfire @SkiFire13 I have closed the conversation for the issues that I think should be addressed now. I have completely rewritten The fixes are in separate commits for easier review. |
I ran some of the core benchmarks, decent improvements for the
The zip case is interesting (0..100000).skip(100).cycle().skip(100)
.zip((0..100000).cycle().skip(10))
.map(|(a,b)| a+b)
.skip(100000)
.take(1000000)
.sum() The outer |
☔ The latest upstream changes (presumably #87768) made this pull request unmergeable. Please resolve the merge conflicts. |
910e4db
to
046e12e
Compare
This comment has been minimized.
This comment has been minimized.
046e12e
to
c41df9b
Compare
This comment has been minimized.
This comment has been minimized.
c41df9b
to
3972694
Compare
☔ The latest upstream changes (presumably #87375) made this pull request unmergeable. Please resolve the merge conflicts. |
3972694
to
36d0b6d
Compare
☔ The latest upstream changes (presumably #89158) made this pull request unmergeable. Please resolve the merge conflicts. |
36d0b6d
to
02955d2
Compare
This comment has been minimized.
This comment has been minimized.
02955d2
to
f4d288a
Compare
☔ The latest upstream changes (presumably #89386) made this pull request unmergeable. Please resolve the merge conflicts. |
Co-authored-by: Ivan Tham <pickfire@riseup.net>
f4d288a
to
ffd7ade
Compare
This looks reasonable to me. @bors r+ |
📌 Commit ffd7ade has been approved by |
…shtriplett implement advance_(back_)_by on more iterators Add more efficient, non-default implementations for `feature(iter_advance_by)` (rust-lang#77404) on more iterators and adapters. This PR only contains implementations where skipping over items doesn't elide any observable side-effects such as user-provided closures or `clone()` functions. I'll put those in a separate PR.
…shtriplett implement advance_(back_)_by on more iterators Add more efficient, non-default implementations for `feature(iter_advance_by)` (rust-lang#77404) on more iterators and adapters. This PR only contains implementations where skipping over items doesn't elide any observable side-effects such as user-provided closures or `clone()` functions. I'll put those in a separate PR.
…ingjubilee Rollup of 13 pull requests Successful merges: - rust-lang#83655 ([aarch64] add target feature outline-atomics) - rust-lang#87091 (implement advance_(back_)_by on more iterators) - rust-lang#88451 (Fix an ICE caused by type mismatch errors being ignored) - rust-lang#88452 (VecDeque: improve performance for From<[T; N]>) - rust-lang#89400 (Improve wording of `map_or_else` docs) - rust-lang#89407 (Recommend running `cargo clean` in E0514 output) - rust-lang#89443 (Include the length in BTree hashes) - rust-lang#89444 (rustdoc: use slice::contains instead of open-coding it) - rust-lang#89447 (Improve error message for missing angle brackets in `[_]::method`) - rust-lang#89453 (Consistently use 'supertrait'.) - rust-lang#89483 (Practice diagnostic message convention) - rust-lang#89500 (Fix ICE with buffered lint referring to AST node deleted by everybody_loops) - rust-lang#89508 (Stabilize `const_panic`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Add more efficient, non-default implementations for
feature(iter_advance_by)
(#77404) on more iterators and adapters.This PR only contains implementations where skipping over items doesn't elide any observable side-effects such as user-provided closures or
clone()
functions. I'll put those in a separate PR.