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

Add archetype cache to queries #53

Closed
cart opened this issue Jul 12, 2020 · 6 comments
Closed

Add archetype cache to queries #53

cart opened this issue Jul 12, 2020 · 6 comments
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible

Comments

@cart
Copy link
Member

cart commented Jul 12, 2020

Currently hecs queries iterate over all archetypes to check if that archetype matches the query. For a small number of archetypes, this is probably faster, but it will get more expensive as the number of archetypes (and/or number of components per archetype) gets larger. for a game engine (which will have many archetypes), it makes sense to have a cache. we could then invalidate the cache whenever an archetype is added/removed.

@cart
Copy link
Member Author

cart commented Jul 28, 2020

resolved by: bd8e979

@cart cart closed this as completed Jul 28, 2020
@cart
Copy link
Member Author

cart commented Jul 29, 2020

reopening because bd8e979 doesnt actually change iteration

@cart cart reopened this Jul 29, 2020
@karroffel karroffel added the C-Feature A new feature, making something new possible label Aug 12, 2020
@DJMcNab
Copy link
Member

DJMcNab commented Jan 22, 2021

I think this was fixed by #863 - at least QueryIter now has an archetypes field.

@cart
Copy link
Member Author

cart commented Jan 22, 2021

Note quite. It has an archetypes field, but it doesn't cache matches, which means we need to check every archetype every time. My bevy_ecs core rewrite adds "stateful queries" which cache these results.

@alice-i-cecile
Copy link
Member

Is this closed by #1525 @cart?

@cart
Copy link
Member Author

cart commented Mar 7, 2021

Yup!

@cart cart closed this as completed Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

4 participants