You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the filters within a query are deterministic and will always yield the same result for each archetype/chunkset/chunk. The only exception to this is the ComponentChangedFilter.
If we could cache the matches for a query between executions, we could skip most of the work and need only resume the query from the last archetype/chunkset/chunk it had seen, needing only to inspect new elements. Caching for all three levels in a data structure that is faster to read than the full query itself may be tricky, but caching only archetype matches should be trivial and offer significant potential performance gains.
This could tie well into system execution. Systems currently need to pre-execute queries to determine which archetypes the system will access, as part of its scheduling logic. If systems could cache their archetype matches between executions, then that would both allow for incremental querying (inspecting only new archetypes each frame), and eliminate an additional query execution from each system. It would also allow systems to cheaply determine if their queries match any entities, which may allow us to automatically disable inactive systems (although this would have to be opt-in for each system).
The text was updated successfully, but these errors were encountered:
Most of the filters within a query are deterministic and will always yield the same result for each archetype/chunkset/chunk. The only exception to this is the
ComponentChangedFilter
.If we could cache the matches for a query between executions, we could skip most of the work and need only resume the query from the last archetype/chunkset/chunk it had seen, needing only to inspect new elements. Caching for all three levels in a data structure that is faster to read than the full query itself may be tricky, but caching only archetype matches should be trivial and offer significant potential performance gains.
This could tie well into
system
execution. Systems currently need to pre-execute queries to determine which archetypes the system will access, as part of its scheduling logic. If systems could cache their archetype matches between executions, then that would both allow for incremental querying (inspecting only new archetypes each frame), and eliminate an additional query execution from each system. It would also allow systems to cheaply determine if their queries match any entities, which may allow us to automatically disable inactive systems (although this would have to be opt-in for each system).The text was updated successfully, but these errors were encountered: