Multiple entities with data components vs one Entity with a single data Component

Hey what’s up!

I am curious about optimal use of Entities and Components. If I need to generate a bunch of vertices for a mesh, would it be more optimal to represent each vertex as its own entity for system work? Or would it be more optimal to simply use an entity with a component that stores each vertex.

Is it more optimal to spread the data over multiple entities, or compact the data into one entity and a component that collects them together.

What are you doing with the vertices? How many are you working with? Do all the vertices have the same types of data associated with them?

I believe most people use DynamicBuffers for this sort of thing.

Generating meshes. There may be more data than just the vertices, but that falls under the same umbrella.

A Dynamic Buffer can be used to gather all of the vertices at once, but I wasn’t sure if this would suffice compared to some kind of system that represents them as their own entities for a more parallel approach.

Well an entity per vertex adds a lot of additional entity and chunk overhead, which is fine if you have a lot of complex data and relationships, but is probably detrimental in your use case. Perhaps an entity per mesh or just a NativeContainer on an entity would be better.