Search Unity

Big CPU overhead after converting scene to entity

Discussion in 'Entity Component System' started by rastleks, Mar 3, 2020.

  1. rastleks

    rastleks

    Joined:
    Jul 17, 2014
    Posts:
    49
    Hello.

    I decided to try Entities to reduce battery consumption.
    And my first try, as i think, failed.

    I have simple scene with bunch of instanced 3D low poly objects and small amount of textures.

    Without using entities at all i have this:
    Batches 107
    Tris 36.8k
    CPU load 3.5ms

    IMPORTANT! I don't have any logic in this scene, but entities package already imported.

    After i convert all scene objects to entities, i have this:
    Batches 27
    Tris 40.1k
    CPU load 5.6 ms

    So because of this there is less FPS and as i can suggest - more battery consumption.

    Can someone, please, explain me this :)? May be i understand something wrong?

    Unity 2019.3.1f1
    URP 7.1.8
    Entities 0.6.0
    Hybrid Renderer 0.3.4
     
    Last edited: Mar 4, 2020
  2. Mockarutan

    Mockarutan

    Joined:
    May 22, 2011
    Posts:
    159
    Are the objects static? There is a "Static Optimized Entity" component you can place on gameobjects the will be converted and never moved. Then there is a "FrozenTag" you can use to make the rendering not have to update anything about the mesh after the first run. The FrozenTag is a bit tricky to set up if you are not using the sub scenes workflow though.
     
  3. BackgroundMover

    BackgroundMover

    Joined:
    May 9, 2015
    Posts:
    224
    If you open the Entities Debugger window, it lists all your systems and how many milliseconds each is using, it could help narrow it down. Maybe the editor LiveLink system?
     
    rastleks likes this.
  4. rastleks

    rastleks

    Joined:
    Jul 17, 2014
    Posts:
    49
    I don't want them to be static ))
     
  5. rastleks

    rastleks

    Joined:
    Jul 17, 2014
    Posts:
    49
    I'll check it tomorrow, thank you)
     
  6. rastleks

    rastleks

    Joined:
    Jul 17, 2014
    Posts:
    49
    In entity debugger i don't see this overhead. But i still se it in statistic window in game view :D
    Can't understand anything )))
     
  7. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Are you on built-in render pipeline or URP/HDRP?
     
  8. rastleks

    rastleks

    Joined:
    Jul 17, 2014
    Posts:
    49
    URP 7.1.8
     
  9. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    SRP batcher enabled? Plus current URP support for HR a bit limited, coming HRv2 should be better.
     
  10. liiir1985

    liiir1985

    Joined:
    Jul 30, 2014
    Posts:
    147
    DOTS run significantly slower in Editor, about 2x even 3x the time is needed as built to standalone player. I think you should build it to real device to see the result more accurately