Is optimization like this possible?
auto& column = getSmallestSizeColumn<Components...>();
for (auto& component in column)
{
auto entity = getEntity(component)
if (entity.Contains<Components...>()) { f(entity, cs...); }
}
When finding entities_with_components, iterate over the smallest size column to find entities instead of iterate all entities should get performance benefits when some components rarely exist.
Is optimization like this possible?
When finding entities_with_components, iterate over the smallest size column to find entities instead of iterate all entities should get performance benefits when some components rarely exist.