bevy_replicon icon indicating copy to clipboard operation
bevy_replicon copied to clipboard

Use `EntityWorldMut::insert_by_ids`

Open Shatur opened this issue 1 year ago • 1 comments

Currently, we insert components one by one, which causes a lot of archetype moves and behaves somewhat unexpectedly with observers/hooks. To solve this, we could pass a special buffer for components instead of using Commands, and after all insertions, call EntityWorldMut::insert_by_ids.

Shatur avatar Oct 10 '24 15:10 Shatur

If bevy implements command batching, this would no longer be a perf issue (although observers might still run separately).

UkoeHB avatar Oct 10 '24 17:10 UkoeHB