bevy/crates/bevy_utils/src
re0312 0f27500e46
Improve par_iter and Parallel (#12904)
# Objective

- bevy usually use `Parallel::scope` to collect items from `par_iter`,
but `scope` will be called with every satifified items. it will cause a
lot of unnecessary lookup.

## Solution

- similar to Rayon ,we introduce `for_each_init` for `par_iter` which
only be invoked when spawn a task for a group of items.

---

## Changelog

- added  `for_each_init`

## Performance
`check_visibility `  in  `many_foxes ` 

![image](https://github.com/bevyengine/bevy/assets/45868716/030c41cf-0d2f-4a36-a071-35097d93e494)
 
~40% performance gain in `check_visibility`.

---------

Co-authored-by: James Liu <contact@jamessliu.com>
2024-04-23 12:05:34 +00:00
..
cow_arc.rs impl Borrow and AsRef for CowArc (#11616) 2024-01-30 14:27:53 +00:00
default.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
futures.rs Async pipeline compilation (#10812) 2024-02-05 13:50:50 +00:00
lib.rs Moves intern and label modules into bevy_ecs (#12772) 2024-04-08 15:34:11 +00:00
once.rs move once from bevy_log to bevy_utils, to allow for it's use in bevy_ecs (#11419) 2024-01-19 06:07:41 +00:00
parallel_queue.rs Improve par_iter and Parallel (#12904) 2024-04-23 12:05:34 +00:00
short_names.rs change 'collapse_type_name' to retain enum types (#9587) 2023-08-26 14:50:12 +00:00
synccell.rs Replace pointer castings (as) by their API equivalent (#11818) 2024-02-11 23:19:36 +00:00
syncunsafecell.rs Cleanup the multithreaded executor (#12969) 2024-04-16 02:37:19 +00:00