bevy/crates
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
..
bevy_a11y Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_animation Make AnimationPlayer::start and ::play work accordingly to documentation (#14546) 2024-07-31 14:07:53 +00:00
bevy_app Fix common capitalization errors in documentation (#14562) 2024-07-31 21:16:05 +00:00
bevy_asset Fix common capitalization errors in documentation (#14562) 2024-07-31 21:16:05 +00:00
bevy_audio Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_color Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_core Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_core_pipeline Reflection for DepthOfFieldSettings (#14588) 2024-08-02 15:36:39 +00:00
bevy_derive Remove deprecated bevy_dynamic_plugin (#14534) 2024-07-30 15:31:08 +00:00
bevy_dev_tools Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_diagnostic Add freebsd support for sysinfo (#14553) 2024-07-31 21:41:40 +00:00
bevy_dylib Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_ecs Opportunistically use dense iteration for archetypal iteration (#14049) 2024-08-02 21:18:15 +00:00
bevy_encase_derive Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_gilrs Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_gizmos Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_gltf Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_hierarchy Add with_child to simplify spawning when there will only be one child (#14594) 2024-08-02 15:37:15 +00:00
bevy_input Fix common capitalization errors in documentation (#14562) 2024-07-31 21:16:05 +00:00
bevy_internal Remove deprecated bevy_dynamic_plugin (#14534) 2024-07-30 15:31:08 +00:00
bevy_log Fix common capitalization errors in documentation (#14562) 2024-07-31 21:16:05 +00:00
bevy_macro_utils Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_math Add Dir2::from_xy_unchecked and Dir3::from_xyz_unchecked (#14587) 2024-08-02 13:10:13 +00:00
bevy_mikktspace Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_pbr Don’t prepare lights (and shadow map textures) for 2D cameras (#14574) 2024-08-01 19:29:18 +00:00
bevy_picking Remove manual --cfg docsrs (#14376) 2024-07-22 18:58:04 +00:00
bevy_ptr Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_reflect bevy_reflect: Adding support for Atomic values (#14419) 2024-07-29 23:33:18 +00:00
bevy_render Add depth_ndc_to_view_z for cpu-side (#14590) 2024-08-02 15:37:29 +00:00
bevy_scene Change SceneInstanceReady to trigger an observer. (#13859) 2024-07-30 21:23:48 +00:00
bevy_sprite fix asymmetrical 9-slicing (#14148) 2024-08-01 20:03:23 +00:00
bevy_state Add note on StatesPlugin requirement for state code (#14489) 2024-07-29 23:41:14 +00:00
bevy_tasks Fix common capitalization errors in documentation (#14562) 2024-07-31 21:16:05 +00:00
bevy_text Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_time time_system is ambiguous_with event_update_system (#14544) 2024-07-31 12:13:17 +00:00
bevy_transform Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_ui Fix UI texture atlas with offset (#13620) 2024-07-30 15:31:58 +00:00
bevy_utils Fix common capitalization errors in documentation (#14562) 2024-07-31 21:16:05 +00:00
bevy_window Properly handle repeated window close requests (#14573) 2024-08-01 16:15:28 +00:00
bevy_winit Fix common capitalization errors in documentation (#14562) 2024-07-31 21:16:05 +00:00