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 graph #130

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Add archetype graph #130

wants to merge 5 commits into from

Conversation

memorycode
Copy link
Contributor

@memorycode memorycode commented Oct 22, 2024

This PR implements an accelerating data structure for changing archetypes. It adds an edges field to Archetype that maps a component ID to the possible archetypes to move to if you added or removed that component. It can be considered a naive implementation of an archetype graph.

With this PR, and with buffering on, I've seen a 40% improvement in insertion speed on 0.9, and a 30% improvement in insertion speed from Matter 0.8. In other words, without this PR 0.9 is 10% slower than 0.8, but with this PR it is 30% faster than 0.8.

@memorycode memorycode marked this pull request as draft October 22, 2024 21:42
@memorycode memorycode marked this pull request as ready for review October 22, 2024 21:51
@memorycode memorycode closed this Oct 22, 2024
@memorycode memorycode reopened this Nov 20, 2024
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

Successfully merging this pull request may close these issues.

1 participant