Skip to content

update_reparented performs an O(n) table scan over all entities with parents #23155

@alice-i-cecile

Description

@alice-i-cecile

Problem

update_reparented performs a change detection scan over every entity with a ChildOf component.

This is slow at high entity count!

On 0.18 update_reparented has a pretty gnarly perf issue. I have almost no ui, but I am paying 8ms every frame to run that system because I have 4m entities.
system{name="bevy_app::propagate::update_reparented<bevy_ui::ui_node::ComputedUiTargetCamera, (), bevy_ecs::hierarchy::ChildOf>"}
system{name="bevy_app::propagate::update_reparented<bevy_ui::ui_node::ComputedUiRenderTargetInfo, (), bevy_ecs::hierarchy::ChildOf>"}

As reported by @aevyrie

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UIGraphical user interfaces, styles, layouts, and widgetsC-PerformanceA change motivated by improving speed, memory usage or compile timesP-RegressionFunctionality that used to work but no longer does. Add a test for this!S-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions