mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 06:30:19 +00:00
563d6e36bb
# Objective If we add the stack index to `Node` then we don't need to walk the `UiStack` repeatedly during extraction. ## Solution Add a field `stack_index` to `Node`. Update it in `ui_stack_system`. Iterate queries directly in the UI's extraction systems. ### Benchmarks ``` cargo run --profile stress-test --features trace_tracy --example many_buttons -- --no-text --no-borders ``` frames (yellow this PR, red main): <img width="447" alt="frames-per-second" src="https://github.com/bevyengine/bevy/assets/27962798/385c0ccf-c257-42a2-b736-117542d56eff"> `ui_stack_system`: <img width="585" alt="ui-stack-system" src="https://github.com/bevyengine/bevy/assets/27962798/2916cc44-2887-4c3b-a144-13250d84f7d5"> extract schedule: <img width="469" alt="extract-schedule" src="https://github.com/bevyengine/bevy/assets/27962798/858d4ab4-d99f-48e8-b153-1c92f51e0743"> --- ## Changelog * Added the field `stack_index` to `Node`. * `ui_stack_system` updates `Node::stack_index` after a new `UiStack` is generated. * The UI's extraction functions iterate a query directly rather than walking the `UiStack` and doing lookups. |
||
---|---|---|
.. | ||
bevy_a11y | ||
bevy_animation | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_derive | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_ecs_compile_fail_tests | ||
bevy_encase_derive | ||
bevy_gilrs | ||
bevy_gizmos | ||
bevy_gltf | ||
bevy_hierarchy | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_macros_compile_fail_tests | ||
bevy_math | ||
bevy_mikktspace | ||
bevy_pbr | ||
bevy_ptr | ||
bevy_reflect | ||
bevy_reflect_compile_fail_tests | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_tasks | ||
bevy_text | ||
bevy_time | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |