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

impl IntoParallelIterator for tuples => MultiZip #711

Merged
merged 3 commits into from Dec 18, 2019
Merged

Conversation

@cuviper
Copy link
Member

cuviper commented Dec 5, 2019

This is implemented for tuples up to arity 12, much like the standard
library's trait implementations.

  • For (a, b, ...), it calls into_par_iter() on each member.
  • For &(a, b, ...), it calls par_iter() on each member.
  • For &mut (a, b, ...), it calls par_iter_mut() on each member.

The resulting MultiZip iterator returns a tuple of the zipped items
from each input iterator. Internally, it is implemented with macros that
forward to a series of regular zips, mapping to a flattened tuple.

Closes #567.

cuviper added 3 commits Dec 5, 2019
This is implemented for tuples up to arity 12, much like the standard
library's trait implementations.

- For `(a, b, ...)`, it calls `into_par_iter()` on each member.
- For `&(a, b, ...)`, it calls `par_iter()` on each member.
- For `&mut (a, b, ...)`, it calls `par_iter_mut()` on each member.

The resulting `MultiZip` iterator returns a tuple of the zipped items
from each input iterator. Internally, it is implemented with macros that
forward to a series of regular `zip`s, mapping to a flattened tuple.
@cuviper cuviper force-pushed the cuviper:multizip branch from d41cfb3 to c0dd154 Dec 5, 2019
@cuviper cuviper changed the title impl IntoIterator for tuples => MultiZip impl IntoParallelIterator for tuples => MultiZip Dec 5, 2019
@nikomatsakis

This comment has been minimized.

Copy link
Member

nikomatsakis commented Dec 18, 2019

My obvious hesitation is that this goes beyond the surface area of libstd. But I think it makes a lot of sense to have IntoParallelIterator on tuples and zipping is the obvious meaning.

Copy link
Member

nikomatsakis left a comment

Code looks very good. r=me

@nikomatsakis

This comment has been minimized.

Copy link
Member

nikomatsakis commented Dec 18, 2019

bors r+

bors bot added a commit that referenced this pull request Dec 18, 2019
Merge #711
711: impl IntoParallelIterator for tuples => MultiZip r=nikomatsakis a=cuviper

This is implemented for tuples up to arity 12, much like the standard
library's trait implementations.

- For `(a, b, ...)`, it calls `into_par_iter()` on each member.
- For `&(a, b, ...)`, it calls `par_iter()` on each member.
- For `&mut (a, b, ...)`, it calls `par_iter_mut()` on each member.

The resulting `MultiZip` iterator returns a tuple of the zipped items
from each input iterator. Internally, it is implemented with macros that
forward to a series of regular `zip`s, mapping to a flattened tuple.

Closes #567.

Co-authored-by: Josh Stone <cuviper@gmail.com>
@bors

This comment has been minimized.

Copy link
Contributor

bors bot commented Dec 18, 2019

@cuviper

This comment has been minimized.

Copy link
Member Author

cuviper commented Dec 18, 2019

It seems windows-gnu is broken: rust-lang/rust#67408

bors bot added a commit that referenced this pull request Dec 18, 2019
Merge #714
714: Reduce Windows CI to just stable Rust r=cuviper a=cuviper

CI for #711 ran into a broken beta windows-gnu toolchain, which is frustrating, but in general I already feel that it's overkill to test so much on Windows. The Linux builds on Travis CI already test a breadth of compiler versions, and it does so in parallel, whereas Appveyor runs serially. We can just test Windows stable to be sure the platform works at all, and leave it at that.

Co-authored-by: Josh Stone <cuviper@gmail.com>
@cuviper

This comment has been minimized.

Copy link
Member Author

cuviper commented Dec 18, 2019

bors retry

bors bot added a commit that referenced this pull request Dec 18, 2019
Merge #711
711: impl IntoParallelIterator for tuples => MultiZip r=nikomatsakis a=cuviper

This is implemented for tuples up to arity 12, much like the standard
library's trait implementations.

- For `(a, b, ...)`, it calls `into_par_iter()` on each member.
- For `&(a, b, ...)`, it calls `par_iter()` on each member.
- For `&mut (a, b, ...)`, it calls `par_iter_mut()` on each member.

The resulting `MultiZip` iterator returns a tuple of the zipped items
from each input iterator. Internally, it is implemented with macros that
forward to a series of regular `zip`s, mapping to a flattened tuple.

Closes #567.

Co-authored-by: Josh Stone <cuviper@gmail.com>
@bors

This comment has been minimized.

Copy link
Contributor

bors bot commented Dec 18, 2019

@bors bors bot merged commit c0dd154 into rayon-rs:master Dec 18, 2019
2 checks passed
2 checks passed
bors Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.