bevy/crates/bevy_ecs/src
re0312 8235daaea0
Opportunistically use dense iteration for archetypal iteration (#14049)
# Objective
- currently, bevy employs sparse iteration if any of the target
components in the query are stored in a sparse set. it may lead to
increased cache misses in some cases, potentially impacting performance.
- partial fixes #12381 

## Solution

- use dense iteration when an archetype and its table have the same
entity count.
- to avoid introducing complicate unsafe noise, this pr only implement
for `for_each ` style iteration.
- added a benchmark to test performance for hybrid iteration.


## Performance


![image](https://github.com/bevyengine/bevy/assets/45868716/5cce13cf-6ff2-4861-9576-e75edc63bd46)

nearly 2x win in specific scenarios, and no performance degradation in
other test cases.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Christian Hughes <9044780+ItsDoot@users.noreply.github.com>
2024-08-02 21:18:15 +00:00
..
entity Fix Entity Debug Format (#14539) 2024-07-31 01:36:41 +00:00
event Minimal Bubbling Observers (#13991) 2024-07-15 13:39:41 +00:00
identifier feat: Reflection implementations on Identifier (#13648) 2024-06-03 16:33:14 +00:00
observer Fix typo in World::observe (#14492) 2024-07-27 13:55:44 +00:00
query Opportunistically use dense iteration for archetypal iteration (#14049) 2024-08-02 21:18:15 +00:00
reflect Track source location in change detection (#14034) 2024-07-30 12:02:38 +00:00
schedule Fix common capitalization errors in documentation (#14562) 2024-07-31 21:16:05 +00:00
storage Track source location in change detection (#14034) 2024-07-30 12:02:38 +00:00
system B0003: Print caller (#14556) 2024-08-01 00:14:48 +00:00
world B0003: Print caller (#14556) 2024-08-01 00:14:48 +00:00
archetype.rs Component Lifecycle Hook & Observer Trigger for replaced values (#14212) 2024-07-15 15:24:15 +00:00
batching.rs Parallel event reader (#12554) 2024-04-22 16:37:42 +00:00
bundle.rs Track source location in change detection (#14034) 2024-07-30 12:02:38 +00:00
change_detection.rs Track source location in change detection (#14034) 2024-07-30 12:02:38 +00:00
component.rs Component Lifecycle Hook & Observer Trigger for replaced values (#14212) 2024-07-15 15:24:15 +00:00
intern.rs Moves intern and label modules into bevy_ecs (#12772) 2024-04-08 15:34:11 +00:00
label.rs Add mappings to EntityMapper (#13727) 2024-06-08 12:52:23 +00:00
lib.rs Fix rust beta lints (#14537) 2024-07-31 01:27:26 +00:00
removal_detection.rs Created an EventMutator for when you want to mutate an event before reading (#13818) 2024-07-08 14:53:06 +00:00
traversal.rs Minimal Bubbling Observers (#13991) 2024-07-15 13:39:41 +00:00