Search Unity

Resolved Will EntityCommandBuffer operations for 'entity queries evaluated at playback time' return?

Discussion in 'DOTS Dev Blitz Day 2022 - Q&A' started by Rupture13, Dec 8, 2022.

  1. Rupture13

    Rupture13

    Joined:
    Apr 12, 2016
    Posts:
    131
    A while ago, the EntityCommandBuffer operations that work on an entityQuery that is evaluated at playback time were removed.
    This leaves us with two remaining options:
    1. Calling the operation on every individual entity in the query.
    2. Calling the operation on a NativeArray of the entities in the query, which therefore is evaluated at command issuing time.
    Both of these to me seem inferior in terms of performance than the removed option. Am I correct in that? If so, will the removed option make its return?
     
  2. cort_of_unity

    cort_of_unity

    Unity Technologies

    Joined:
    Aug 15, 2018
    Posts:
    98
    Thank you for bringing this up; you're definitely not the first. I've raised a proposal internally to restore the previous semantics for these commands. It'll still need to be discussed, approved, and implemented, but the wheel is in motion.
     
    Rupture13 likes this.
  3. cort_of_unity

    cort_of_unity

    Unity Technologies

    Joined:
    Aug 15, 2018
    Posts:
    98
    Hello; I just wanted to pop in and report that I finally have a branch open where I'm working on re-exposing the original "evaluate query at playback" EntityCommandBuffer semantics. It was a longer road than expected; the first step was an optimization pass over the "bulk structural change via EntityQuery" methods on EntityManager, since the ECB implementation is just calling the same code path at playback time. The good news is that it looks like we've got their performance back into the Entities-0.17-era neighborhood, several of orders of magnitude faster than what was in the 1.0-preview releases. So now it's just the ECB work.

    As usual we can't promise availability in any specific future release, or any concrete timelines. But for what it's worth you can consider this change "someday soon", not just "someday".
     
    Rupture13 and optimise like this.
  4. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I wonder at Entities-0.17 what's technical limitation force to remove this ecb entity query playback api and needs to wait until 1.0 to get it back again?
     
  5. cort_of_unity

    cort_of_unity

    Unity Technologies

    Joined:
    Aug 15, 2018
    Posts:
    98
    It wasn't a technical limitation; just a design decision that didn't work out the way we expected.
     
    Rupture13 and optimise like this.
  6. cort_of_unity

    cort_of_unity

    Unity Technologies

    Joined:
    Aug 15, 2018
    Posts:
    98
    These changes are available in the Entities 1.0.11 release. (They also break semver, by adding new APIs in a patch release; sorry about that! The usual validation against such things was on the fritz & didn't catch this case)
     
    Rupture13 likes this.