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

Sparse Components (non-movable components) #23

Open
Ukendio opened this issue May 4, 2024 · 0 comments
Open

Sparse Components (non-movable components) #23

Ukendio opened this issue May 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Ukendio
Copy link
Owner

Ukendio commented May 4, 2024

Non-movable components, that when inserted goes into the sparse set storage. The sparse component itself does not need to be moved to the destination archetype during insertion.

Benefits

  • Doesn't need to move the sparse component itself so slightly faster removals and insertions
  • Fast iteration of single sparse components since it should just iterate over the densely packed pool/column

Drawbacks

  • Explicit storage specification
  • Queries of sparse components are always slower than archetype queries except for two scenarios:
  1. if the query is just interested in a single sparse component (just iterate the dense array of the sparse set)
  2. if fragmentation is very high (like 1-2 entities per archetype, and lots of archetypes)
@Ukendio Ukendio added the enhancement New feature or request label May 4, 2024
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
None yet
Development

No branches or pull requests

1 participant