Skip to content

Storage optimizations #49

@iK4tsu

Description

@iK4tsu

The elements of the sparsed array are always nullentity at the indices where no entity resides. The elements filled with values other than nullentity are guaranteed to map to a valid entity and component. This can make for more optimizations when dealing with deletions and insertions. The packed arrays don't have to be shrunk in size because they are not needed for checks. This leads to faster insertions the more used a Storage is because the packed array already has enough length to store the component and the entity. Instead of using the packed array's length, an auxiliary variable would be needed to keep track of that. When adding, one can take advantage of the previous implementation and have a system that will reserve/resize space with a growth factor to reduce the number of allocations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrefactorImprovements or small fixes of the source code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions