Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further optimization of PackedColumnStorage when get entities_with_components? #193

Open
vrecluse opened this issue Jun 30, 2017 · 0 comments

Comments

@vrecluse
Copy link

vrecluse commented Jun 30, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant