Description
What problem does this solve or what need does it fill?
Currently, change detection is an O(n) operation, where n is the number of components in matching archetypes.
In cases where large amount of change detection must be performed (such as for networking), this check can become a bottleneck.
What solution would you like?
Redundantly store change detection data at two additional levels:
- At the component-type level (the
Column
). - At the archetype level.
Then, when checking for changes to a component, check at the component level, then the archetype level, then the individual component level, breaking early at each step if no recent changes have been detected.
What alternative(s) have you considered?
Only implement one or none of these redundant storages. Evaluating this change will require much more robust change detection benchmarks, see #4883.
Additional context
This will likely be cleaned up by #4809, as these optimizations only make sense for components. Related to #4882, which could further configure this behavior.
This idea was originally discussed by @DJMcNab and @PROMETHIA-27's; I'm just writing it up :)