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

Fast add/remove components via bit flipping. #356

Closed
CooCooCaCha opened this issue Aug 26, 2020 · 3 comments
Closed

Fast add/remove components via bit flipping. #356

CooCooCaCha opened this issue Aug 26, 2020 · 3 comments
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible C-Performance A change motivated by improving speed, memory usage or compile times

Comments

@CooCooCaCha
Copy link

It's well known that adding/removing components is a slow operation in archetype-based ECS systems. One solution that Unity is working on for their ECS (also archetype-based) is using bit flipping to enable/disable components quickly at runtime.

Here's the CTO of Unity describing their approach:
https://forum.unity.com/threads/dots-skill-system-repo-available.894007/#post-5875804

I imagine something like this could be useful for Bevy.

@karroffel karroffel added A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible labels Aug 26, 2020
@alice-i-cecile alice-i-cecile added the C-Performance A change motivated by improving speed, memory usage or compile times label Feb 17, 2021
@alice-i-cecile
Copy link
Member

This should be (largely) addressed with the new sparse component storage that we're targeting for 0.5 :)

@alice-i-cecile
Copy link
Member

alice-i-cecile commented Mar 7, 2021

This was added via sparse set components in #1525 :D

@alice-i-cecile
Copy link
Member

alice-i-cecile commented Mar 11, 2021

This was not added in the end, and would be very useful for fast component add / removals. Making another issue for that topic though.

The adds are computationally quick, but do not allow you to insert or remove components within a single stage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible C-Performance A change motivated by improving speed, memory usage or compile times
Projects
None yet
Development

No branches or pull requests

3 participants