Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove allocation when adding and removing components #224

Open
Anders429 opened this issue Apr 29, 2023 · 0 comments
Open

Remove allocation when adding and removing components #224

Anders429 opened this issue Apr 29, 2023 · 0 comments
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.

Comments

@Anders429
Copy link
Owner

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.

@Anders429 Anders429 added C - Performance Category: Related to performance. C - Code Quality Category: Addressing quality and cleanup of existing code. P - Low Priority: Not particularly urgent. A - Storage Area: Storage inside a World. labels Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant