Ukendio / jecs

A fast, portable Entity Component System for Luau
https://ukendio.github.io/jecs/
MIT License
146 stars 26 forks source link

Sparse Components (non-movable components) #23

Open Ukendio opened 6 months ago

Ukendio commented 6 months ago

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

Drawbacks

  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)