evaera / matter

A modern ECS library for Roblox.
https://eryn.io/matter/
MIT License
144 stars 34 forks source link

Return chainable iterator after `QueryResult:without()` #90

Open Ukendio opened 8 months ago

Ukendio commented 8 months ago

This PR resolves #85.

At initial commit, it passes every test. No regressions and it also works well for the intended use case of chaining with snapshot or view.

However, the code is just glued together and will require quite a bit of polishing before I am confident in shipping this out. The code changes are the minimum steps I took to ensure it passed the tests. And I would like to make sure this code is good enough before I am confident in having it reviewed.

List of things to address first

TODO

Ukendio commented 8 months ago

image

Case "QueryRework" is the changes to World's query reflected in the PR. Case "Without" is a separate change that does archetype negation for making more narrow subsets of queries #91 .

203 components, 3 archetypes. Looped a query that implements queryResult:without() 100 times.

When not using without, they are equivalent in speed, favouring "QueryRework" and "Without" due to small micro optimizations image

LastTalon commented 8 months ago

Can we get this linked to an issue that explains what the PR is solving to keep that documented for the future?

Ukendio commented 8 months ago

Can we get this linked to an issue that explains what the PR is solving to keep that documented for the future?

I have now edited the comment to link the relevant issue