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

par_iter for Range*<char> #770

Closed
CAD97 opened this issue Jun 17, 2020 · 1 comment · Fixed by #771
Closed

par_iter for Range*<char> #770

CAD97 opened this issue Jun 17, 2020 · 1 comment · Fixed by #771

Comments

@CAD97
Copy link
Contributor

CAD97 commented Jun 17, 2020

With rust-lang/rust#72413, ranges of char are now iterable (in 1.45, releasing 2020-07-16). Rayon should support iterating them in parallel just like normal continuous integer ranges.

I've done experimentation previously, which suggested that chain(chars before surrogate range, chars after surrogate range) is the optimal ParallelIterator for Range*<char>.

I've very little experience with implementing parallel iterators, however, so that could be untrue.

@cuviper
Copy link
Member

cuviper commented Jun 17, 2020

Sure, we can add that.

A chain sounds fine, but I wouldn't necessarily encode that in the iterator fields. It could just use rayon::range::Iter<char>, and then in its specific fn drive it can forward to something like (start as u32..end as u32).into_par_iter().map(/*to char*/).drive(..), or chained if needed to skip surrogates. Point is, that implement choice can be dynamic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants