Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Despawn with children doesn't need to remove entities from parents children when parents are also removed #2278

Conversation

mockersf
Copy link
Member

Fixes #2274

When calling despawn_recursive, the recursive loop doesn't need to remove the entity from the children list of its parent when the parent will also be deleted

Upside:

  • Removes two entity lookup per entity being recursively despawned

Downside:

  • The change detection on the Children component of a deleted entity in the despawned hierarchy will not be triggered

@NathanSWard NathanSWard added A-Core Common functionality for all bevy apps C-Performance A change motivated by improving speed, memory usage or compile times labels May 29, 2021
@TheNeikos
Copy link
Contributor

Is there even a way to detect a changed component of a removed entity?

@cart
Copy link
Member

cart commented May 30, 2021

Is there even a way to detect a changed component of a removed entity?

Currently no, although that might change in the future. We can revisit later if we implement "removed component change detection" and it becomes an issue.

@cart
Copy link
Member

cart commented May 30, 2021

bors r+

bors bot pushed a commit that referenced this pull request May 30, 2021
…ildren when parents are also removed (#2278)

Fixes #2274 

When calling `despawn_recursive`, the recursive loop doesn't need to remove the entity from the children list of its parent when the parent will also be deleted

Upside:
* Removes two entity lookup per entity being recursively despawned

Downside:
* The change detection on the `Children` component of a deleted entity in the despawned hierarchy will not be triggered
@bors bors bot changed the title Despawn with children doesn't need to remove entities from parents children when parents are also removed [Merged by Bors] - Despawn with children doesn't need to remove entities from parents children when parents are also removed May 30, 2021
@bors bors bot closed this May 30, 2021
ostwilkens pushed a commit to ostwilkens/bevy that referenced this pull request Jul 27, 2021
…ildren when parents are also removed (bevyengine#2278)

Fixes bevyengine#2274 

When calling `despawn_recursive`, the recursive loop doesn't need to remove the entity from the children list of its parent when the parent will also be deleted

Upside:
* Removes two entity lookup per entity being recursively despawned

Downside:
* The change detection on the `Children` component of a deleted entity in the despawned hierarchy will not be triggered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Core Common functionality for all bevy apps C-Performance A change motivated by improving speed, memory usage or compile times
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants