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

Cached Querys #135

Open
genaray opened this issue Aug 24, 2023 · 0 comments
Open

Cached Querys #135

genaray opened this issue Aug 24, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@genaray
Copy link
Owner

genaray commented Aug 24, 2023

Problem

Each Query currently iterates the whole list of Archetypes. This is bad for scenarios with many archetypes.

Instead each query should ONLY iterate archetypes that fits its description.

Solution

We need some way to map a Query to its Archetypes and a Archetype to its Querys in a decoupled way.
Therefore, we could add a QueryCache to the World that exactly does this mapping and validates the process.

public class QueryCache{

   internal Dictionary<Query, List<Archetype>> QueryToArchetype;
   internal Dictionary<Archetype, List<Query>> ArchetypeToQuerys;
}

Or as an alternative we put those lists directly into the Query and Archetype. This however would couple the classes to another which is generally not a great idea for refactoring and maintainability reasons.

@genaray genaray added the enhancement New feature or request label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

1 participant