Sparse set components in filters force sparse set iteration #2144
Labels
A-ECS
Entities, components, systems, and events
C-Performance
A change motivated by improving speed, memory usage or compile times
D-Complex
Quite challenging from either a design or technical perspective. Ask for help!
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
To refresh on sparse sets vs table component storages:
If a query has any sparse set components, we must use sparse set iteration as we don't have a single query. This is suboptimal if the sparse set components only exist in the filters, e.g
Query<&Dense, With<Sparse>
. All of the actual data we need to iterate over exists in table storage though, so this is a needless cost.This is a common and natural pattern, especially if you're using sparse set marker components, so fixing this problem would help ensure that sparse-set components actually accomplish their promised perf benefits in real applications.
@cart raised this on Discord.
The text was updated successfully, but these errors were encountered: