Search Unity

Feedback Performance degradation of BuildPhysicsWorld with Entities 0.5.0

Discussion in 'Entity Component System' started by Yuriy_Sevastyanov, Jan 21, 2020.

  1. Yuriy_Sevastyanov

    Yuriy_Sevastyanov

    Joined:
    Apr 9, 2017
    Posts:
    25
    A few day ago I switched to Entities 0.5.0. And now I came across a problem with frame by frame performance degradation.
    To reproduce:
    1. just put empty game object and add Physics Body and Conver To Entity components.
    2. open profiler
    3. run
    GC.Collect is called more and more often, but I didn't find that on 0.4.0

    Initial screen:
    Initial.png

    After ~30min:
    Degraded.png

    My setup:
    Setup.png
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Disable leak detection. in the jobs menu.
     
  3. Yuriy_Sevastyanov

    Yuriy_Sevastyanov

    Joined:
    Apr 9, 2017
    Posts:
    25
    @Joachim_Ante Thank you for your reply.
    1. I created a new empty project
    2. Installed all necessary packages
    3. Turned off leak detection
    4. Turned off Jobs Debugger
    5. Created empty GameObject on the scene
    6. Added Physics Body + Convert To Entity to it
    7. Run
    8. Wait ~15min
    Performance downgraded from 800 FPS to 150 FPS

    My setup:
    Unity 2019.3.0f5
    manifest.json:
    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.unity.2d.sprite": "1.0.0",
    4.     "com.unity.2d.tilemap": "1.0.0",
    5.     "com.unity.burst": "1.2.0",
    6.     "com.unity.collab-proxy": "1.2.16",
    7.     "com.unity.entities": "0.5.0-preview.17",
    8.     "com.unity.ide.rider": "1.1.4",
    9.     "com.unity.ide.vscode": "1.1.3",
    10.     "com.unity.physics": "0.2.5-preview.1",
    11.     "com.unity.test-framework": "1.1.9",
    12.     "com.unity.textmeshpro": "2.0.1",
    13.     "com.unity.timeline": "1.2.9",
    14.     "com.unity.ugui": "1.0.0",
    15.     "com.unity.modules.ai": "1.0.0",
    16.     "com.unity.modules.androidjni": "1.0.0",
    17.     "com.unity.modules.animation": "1.0.0",
    18.     "com.unity.modules.assetbundle": "1.0.0",
    19.     "com.unity.modules.audio": "1.0.0",
    20.     "com.unity.modules.cloth": "1.0.0",
    21.     "com.unity.modules.director": "1.0.0",
    22.     "com.unity.modules.imageconversion": "1.0.0",
    23.     "com.unity.modules.imgui": "1.0.0",
    24.     "com.unity.modules.jsonserialize": "1.0.0",
    25.     "com.unity.modules.particlesystem": "1.0.0",
    26.     "com.unity.modules.physics": "1.0.0",
    27.     "com.unity.modules.physics2d": "1.0.0",
    28.     "com.unity.modules.screencapture": "1.0.0",
    29.     "com.unity.modules.terrain": "1.0.0",
    30.     "com.unity.modules.terrainphysics": "1.0.0",
    31.     "com.unity.modules.tilemap": "1.0.0",
    32.     "com.unity.modules.ui": "1.0.0",
    33.     "com.unity.modules.uielements": "1.0.0",
    34.     "com.unity.modules.umbra": "1.0.0",
    35.     "com.unity.modules.unityanalytics": "1.0.0",
    36.     "com.unity.modules.unitywebrequest": "1.0.0",
    37.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    38.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    39.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    40.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    41.     "com.unity.modules.vehicles": "1.0.0",
    42.     "com.unity.modules.video": "1.0.0",
    43.     "com.unity.modules.vr": "1.0.0",
    44.     "com.unity.modules.wind": "1.0.0",
    45.     "com.unity.modules.xr": "1.0.0"
    46.   }
    47. }
    48.  
    Result profiling:
    Degraded-2.png

    Thanks
     
  4. florianhanke

    florianhanke

    Joined:
    Jun 8, 2018
    Posts:
    426
  5. Yuriy_Sevastyanov

    Yuriy_Sevastyanov

    Joined:
    Apr 9, 2017
    Posts:
    25
    @florianhanke It looks like the same issue. I can see a lot of PhysicsStep
     
  6. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    The GetSingleton perf issue should be fixed in the next entities release.
    Sounds like its related to this.
     
  7. Yuriy_Sevastyanov

    Yuriy_Sevastyanov

    Joined:
    Apr 9, 2017
    Posts:
    25
  8. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    Is there a patch we can apply in the meantime?
     
    florianhanke likes this.