pub fn map_on_pool<R: Send>(
n: usize,
work: usize,
f: impl Fn(usize) -> R + Sync,
) -> Vec<R>Expand description
[f(0), ..., f(n - 1)], one pool job per item when work (in f64
operations, for all items) is large
A single large item goes to the pool too: the parallel regions inside it then start from a pool thread, which is cheaper than from outside the pool (on an M1 Pro, 3 % of a double-double SVE of a single block).