You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Splitting of parallel iterators working `ArrayView` and `Zip` is currently
not limited and continues until only one element is left which can lead to
excessive overhead for algorithms formulated in terms of these iterators.
Since these iterators are also not indexed, Rayon's generic
`IndexedParallelIterator::with_min_len` does not apply. However, since the
number of elements is known and currently checked against to one to determine if
another split is possible, it appears straight-forward to replace this constant
by a parameter and make it available to the user via a `Parallel::with_min_len`
inherent method.
Copy file name to clipboardExpand all lines: src/parallel/par.rs
+25-9Lines changed: 25 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,24 @@ use crate::split_at::SplitPreference;
21
21
#[derive(Copy,Clone,Debug)]
22
22
pubstructParallel<I>{
23
23
iter:I,
24
+
min_len:usize,
24
25
}
25
26
27
+
impl<I>Parallel<I>{
28
+
/// Sets the minimum number of elements desired to process in each job. This will not be split any smaller than this length, but of course a producer could already be smaller to begin with.
0 commit comments