cuviper on rayon-core-v1.10.2
ThreadPool
each time)
perf
, if that helps
for
loops are hard-coded to the regular Iterator
trait
Iterator::for_each
, then this can translate to ParallelIterator::for_each
out
vector to &mut [AtomicI8]
.
(0..data.len()).into_par_iter().for_each(|i| /* atomic store */)
@jntrnr https://is.gd/QFQpOF
If I'm reading this right, you're saying to break into blocks that are outside of rayon? How would you know what size to split into so that rayon is efficient? Feels like something rayon should do so that it's able to tune for efficiency
rng::thread_rng()
and pass a Sender
to a for_each
loop. Unfortunately for_each_init
requires Sync
as a trait bound, which is not satisfied by Sender
. Is there a way to get both, the functionality of for_each_init
and for_each_with
at the same time?
map_init
to do some computation with the rng, then for_each_with
to send your result.
async move {
let mut con = redis.get_tokio_connection_manager().await.unwrap();
redis::Cmd::sadd(format!("appearances:{}", user_id), appearance)
.query_async::<_, i32>(&mut con)
.await
.unwrap_or_else(|e| panic!("sadd failed with {}", e));
};
the code is inside into_part_iter().for_each()