Search Unity

EntityCommandBuffer vs ExclusiveEntityTransaction?

Discussion in 'Entity Component System' started by Soaryn, Aug 10, 2019.

  1. Soaryn

    Soaryn

    Joined:
    Apr 17, 2015
    Posts:
    328
    In a scenario where an entity's structure (archetype) is unknown until runtime, which entity builder is intended to be faster, the EntityCommandBuffer or the ExclusiveEntityTransaction?

    To elaborate, assume I am constructing an entity based on some message sent to me externally.
    1. I can not change how this data is structured on the emitting side.
    2. The archetype of the entity is dependent on the data emitted.
    Currently, I have been using the ExclusiveEntityTransaction to build my entities as I was under the impression since all of the building is done in a thread for a different world it would be more ideal; however, I have noticed that many functions within the ExclusiveEntityTransaction are not Burst compatible, and every mention there of on the forums I have yet to really get an answer on whether or not it will be burst compatible.

    So the question. If I am building an entity with arbitrary components determined at run time, and I want to spawn as many entities as possible with each archetype being unknown until I read the message, which would be the better route?