Remove allocation when adding and removing components #224
Labels
A - Storage
Area: Storage inside a World.
C - Code Quality
Category: Addressing quality and cleanup of existing code.
C - Performance
Category: Related to performance.
P - Low
Priority: Not particularly urgent.
Currently, adding or removing components requires moving the components from one archetype to another, which requires an allocation here: https://github.com/Anders429/brood/blob/master/src/archetype/mod.rs#L461
Since the components are canonically ordered, this can be optimized away. Rather than popping into a buffer, we can just use the component columns from both archetypes, copying directly from the one into the other.
This is somewhat related to #220.
The text was updated successfully, but these errors were encountered: