bevy_replicon
bevy_replicon copied to clipboard
Use `EntityWorldMut::insert_by_ids`
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.
If bevy implements command batching, this would no longer be a perf issue (although observers might still run separately).