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

Simplify the iterator adaptive splitting strategy #857

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/iter/plumbing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,8 @@ impl Splitter {
let Splitter { splits } = *self;

if stolen {
// This job was stolen! Reset the number of desired splits to the
// thread count, if that's more than we had remaining anyway.
self.splits = cmp::max(crate::current_num_threads(), self.splits / 2);
// This job was stolen! Leave the `splits` count alone while we go ahead and split
// anyway, so we dynamically get more splitting for jobs that are moving a lot.
true
} else if splits > 0 {
// We have splits remaining, make it so.
Expand Down