bevy_simple_tilemap icon indicating copy to clipboard operation
bevy_simple_tilemap copied to clipboard

Parallel iterator performance issues

Open MaxCWhitehead opened this issue 2 years ago • 0 comments

Was seeing some hitches in extract_tilemaps with a low amount of tiles, maybe 100-200? It sometimes gets up to 10ms.

It seems like par_iter is the culprit, I'm not sure what it's default behavior regarding splitting work between tasks, but has a pretty big impact on the time here. I am wondering if perhaps this should be behind a feature flag, or possible disabled by default. (Maybe it could be faster for large enough workloads, unsure).

Below is a histogram of this function, yellow is .iter(), red is .par_iter().

image

MaxCWhitehead avatar Jul 13 '23 09:07 MaxCWhitehead