Store zero-sized components separately
- Ngôn ngữ chính
- Rust
- Star
- 41
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
ZSTs that are components, commonly called "marker" components or "tag" components, may not actually warrant inclusion in the archetype identifier. They are not actually stored, and are just used to mark something about an entity.
I wonder if there is a better solution, using some separate storage for what ZSTs are applied to each entity within an archetype. This way, we don't have to reallocate and move the entire entity when changing what ZSTs are applied to the entity.
We can use some kind of trait extension on `Component`, adding a `IS_ZST` associated constant to the component. Then this can be used to branch when storing or modifying an entity. The sized components will be stored as normal, but the ZST components will be stored in some kind of set, mapping which entity identifiers they are associated with. Care will need to be taken in designing this feature, to ensure it doesn't slow down storage or iterating.
The advantage gained here should be an increase in performance when adding or removing ZSTs from an entity. It will save reallocation and the expensive moving of an entire entity to another archetype.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.