Skip to content

Changed doesn't explain any potential drawback #3082

@djeedai

Description

@djeedai

How can Bevy's documentation be improved?

https://docs.rs/bevy/0.5.0/bevy/ecs/query/struct.Changed.html

The docs mention this is a performance optimization to iterate over changed entities/components only. There's no mention of what the cost of maintaining such information is. Surely this doesn't come "for free"; there must be some caching somewhere to compare with the previous frame's version and be able to tell. What's the cost? Can this be used on many different single-components (like, should I use Changed<MyType> for most of my own types, even if used once or twice only)? Or is it more beneficial on a single component with many instances (like the Changed<Transform> example? Is there a minimum order of magnitude number below which Changed is prohibitive compared to just iterating over all existing items without any caching?

I checked the docs on main too, and it's no better. It just mentions ChangeTrackers in addition; I'm not even understanding the difference between ChangeTrackers and Changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-DocsAn addition or correction to our documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions