Rayon par_iter() auto larger chunks?

Suppose we have something like this:

x.par_iter().map(|_| ...).collect::<Vec<_>>();

Is there a way to tell rayon "there are lots of tasks, but they are small, so assign them to threads in chunks of 100" ?

There're a chunks and par_chunks methods. Would that work ?

1 Like

You can also set that as a lower bound, calling .with_min_len(100) in your iterator chain.

1 Like