bevy/crates/bevy_ui/src
ickshonpe 17e3b850bd
Simplified UI tree navigation without ghost_nodes (#17143)
# Objective

There is a large performance regression in the UI systems in 0.15
because the `UiChildren` and `UiRootRootNodes` system params (even with
`ghost_nodes` disabled) are really inefficient compared to regular
queries and can trigger a heap allocation with large numbers of
children.

## Solution

Replace the `UiChildren` and `UiRootRootNodes` system params with
simplified versions when the `ghost_nodes` feature is disabled.

## Testing

yellow this PR, red main

cargo run --example many_buttons --features "trace_tracy" --release

`ui_stack_system`
<img width="494" alt="stack"
src="https://github.com/user-attachments/assets/4a09485f-0ded-4e54-bd47-ffbce869051a"
/>

`ui_layout_system`
<img width="467" alt="unghosted"
src="https://github.com/user-attachments/assets/9d906b20-66b6-4257-9eef-578de1827628"
/>

`update_clipping_system`
<img width="454" alt="clipping"
src="https://github.com/user-attachments/assets/320b50e8-1a1d-423a-95a0-42799ae72fc5"
/>
2025-01-06 19:22:00 +00:00
..
experimental Simplified UI tree navigation without ghost_nodes (#17143) 2025-01-06 19:22:00 +00:00
layout Remove tracing re-export from bevy_utils (#17161) 2025-01-05 23:06:34 +00:00
render default UI camera extraction fix (#17100) 2025-01-06 18:49:18 +00:00
widget More DefaultUiCamera fixes (#17120) 2025-01-06 19:11:04 +00:00
accessibility.rs Properly set accessible value on label nodes (#16418) 2024-11-17 18:10:41 +00:00
focus.rs More DefaultUiCamera fixes (#17120) 2025-01-06 19:11:04 +00:00
geometry.rs Implement FromStr for Val (#16926) 2024-12-24 02:51:13 +00:00
lib.rs Remove all deprecated code (#16338) 2025-01-05 20:33:39 +00:00
measurement.rs Use CosmicFontSystem in public bevy_text APIs and remove cosmic_text re-export (#16063) 2024-10-23 20:05:28 +00:00
picking_backend.rs More DefaultUiCamera fixes (#17120) 2025-01-06 19:11:04 +00:00
stack.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
ui_material.rs Move required components doc to type doc (#16575) 2024-12-03 19:45:20 +00:00
ui_node.rs Remove tracing re-export from bevy_utils (#17161) 2025-01-05 23:06:34 +00:00
update.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00