Expand description
Parallel for each and map using tokio tasks.
This avoid the problem of sleeping threads with mimalloc when using rayon in combination with tokio. It also avoid having multiple thread pools.
See also: https://pwy.io/posts/mimalloc-cigarette/
Functions§
- available_
parallelism - Returns the recommended amount of parallelism for the current process. Typically the number of available CPU cores.
- for_
each - for_
each_ chunk - Like
for_each, but callsfonce per chunk instead of once per item. A slice too small to be chunked is passed tofas a whole on the calling thread, and an empty slice doesn’t callf. Uses the same chunk sizing asfor_each. - for_
each_ owned - map_
collect - map_
collect_ chunked_ owned - map_
collect_ owned - try_
for_ each - try_
for_ each_ mut - try_
for_ each_ owned