leudz / shipyard

Entity Component System focused on usability and flexibility.
Other
738 stars 44 forks source link

What's the advantage of bulk_add_entity? #159

Closed PudgeKim closed 1 year ago

PudgeKim commented 1 year ago

I don't seem that it uses parallel iterator or something. What's the advantage of using it?

leudz commented 1 year ago

It avoids borrowing the storages multiple times when adding multiple components. And uses Extend on SparseSet's internal Vecs to avoiding multiple reallocation in a short period of time.