Modify bevy_ecs to support removing archetypes and unregistering components
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 4d 8m
- Merged PRs (30d)
- 147
Description
As discussed in https://github.com/bevyengine/rfcs/pull/79 and laid out by @james-j-obrien, Bevy's ECS architecture is not optimized for use in worlds with a very large number of archetypes. Fundamentally:
> `bevy_ecs` currently operates under the assumption that archetype and component ids are dense and strictly increasing.
While this is a blocker for efficient implementation of fragmenting / archetypal relations, it's also worth exploring and fixing in its own right.
There are several steps to this:
- [ ] Remove the sparse set in table storage https://github.com/bevyengine/bevy/pull/14928
- [ ] Replace the FixedBitSet in Access / FilteredAccess https://github.com/bevyengine/bevy/pull/16784
- [ ] Implement a component index, which tracks the tables and archetypes each `ComponentId` belongs to as well as the column in that table the id inhabits (if any)
- [ ] Query and system caches need to be easier to access.
- [ ] Query and system caches must be updated to reflect changes to archetypes
- [ ] Create and expose tools for deleting component ids
- [ ] Create and expose tools for deleting archetypes
This is a tracking issue: as more related work comes along, please link it here and bother Alice to update this issue description.
Contributor guide
Assessment
This issue has not been assessed yet.