Multirious / bevy_tween

Flexible tweening plugin library for Bevy.
Apache License 2.0
87 stars 2 forks source link

Reduce repetitive parent traversal in component tween #7

Open Multirious opened 4 months ago

Multirious commented 4 months ago

TargetComponent::TweenEntity and TargetComponent::TweenParent have to search for their associated tweener every frame which could be a bottleneck of some performance-critical applications with a lot of entities.

Multirious commented 4 months ago

Benchmarking would be valuable here

musjj commented 4 months ago

I'm not that familiar with performance tuning, but bevy_eventlistener is dealing with the same problem of traversing up an entity tree.

Looks like that they're using some kind of cache for it, so maybe it'd be worth looking at how they implement it: https://github.com/aevyrie/bevy_eventlistener/blob/main/src/event_dispatcher.rs#L123