bevy/crates/bevy_ecs/src
Vic 05e61d64f5
implement par_iter_many and par_iter_many_unique (#17815)
# Objective

Continuation of #16547.

We do not yet have parallel versions of `par_iter_many` and
`par_iter_many_unique`. It is currently very painful to try and use
parallel iteration over entity lists. Even if a list is not long, each
operation might still be very expensive, and worth parallelizing.
Plus, it has been requested several times!

## Solution

Once again, we implement what we lack!

These parallel iterators collect their input entity list into a
`Vec`/`UniqueEntityVec`, then chunk that over the available threads,
inspired by the original `par_iter`.

Since no order guarantee is given to the caller, we could sort the input
list according to `EntityLocation`, but that would likely only be worth
it for very large entity lists.

There is some duplication which could likely be improved, but I'd like
to leave that for a follow-up.

## Testing

The doc tests on `for_each_init` of `QueryParManyIter` and
`QueryParManyUniqueIter`.
2025-02-13 19:49:41 +00:00
..
entity Update typos to 1.29.6 (#17850) 2025-02-13 19:44:47 +00:00
event Encapsulate cfg(feature = "track_location") in a type. (#17602) 2025-02-10 21:21:20 +00:00
identifier Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
observer feat(ecs): implement fallible observer systems (#17731) 2025-02-11 22:15:43 +00:00
query implement par_iter_many and par_iter_many_unique (#17815) 2025-02-13 19:49:41 +00:00
reflect Improved Spawn APIs and Bundle Effects (#17521) 2025-02-09 23:32:56 +00:00
relationship Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
schedule feat(ecs): configurable error handling for fallible systems (#17753) 2025-02-11 18:36:08 +00:00
storage Encapsulate cfg(feature = "track_location") in a type. (#17602) 2025-02-10 21:21:20 +00:00
system implement par_iter_many and par_iter_many_unique (#17815) 2025-02-13 19:49:41 +00:00
world Add ComponentId-taking functions to Entity{Ref,Mut}Except to mirror FilteredEntity{Ref,Mut} (#17800) 2025-02-12 18:34:35 +00:00
archetype.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
batching.rs Fix *most* clippy lints (#15906) 2024-10-14 20:52:35 +00:00
bundle.rs Encapsulate cfg(feature = "track_location") in a type. (#17602) 2025-02-10 21:21:20 +00:00
change_detection.rs Expose method to update the internal ticks of Ref and Mut (#17716) 2025-02-11 19:00:13 +00:00
component.rs Encapsulate cfg(feature = "track_location") in a type. (#17602) 2025-02-10 21:21:20 +00:00
entity_disabling.rs Allow users to register their own disabling components / default query filters (#17768) 2025-02-11 18:25:32 +00:00
hierarchy.rs Improved Spawn APIs and Bundle Effects (#17521) 2025-02-09 23:32:56 +00:00
intern.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
label.rs Add compile-time dyn compatible checks for DynEq, DynHash (#17254) 2025-01-09 07:30:54 +00:00
lib.rs Improved Spawn APIs and Bundle Effects (#17521) 2025-02-09 23:32:56 +00:00
name.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
removal_detection.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
resource.rs Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
result.rs feat(ecs): configurable error handling for fallible systems (#17753) 2025-02-11 18:36:08 +00:00
spawn.rs Improved Spawn APIs and Bundle Effects (#17521) 2025-02-09 23:32:56 +00:00
traversal.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00