-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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.