Search Unity

Profiling PostLateUpdate.FinishFrameRendering(). Radically different render times per frame

Discussion in 'Android' started by Antony-Blackett, Apr 25, 2018.

  1. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I'm profiling some low frame rate issues on Android. The bulk of the frame on slow frames is happening in PostLateUpdate.FinishFrameRendering(). The issue I'm having however is not all frames seem to take the same or similar time. Some frames are fast and PostLateUpdate.FinishFrameRendering() completed in 6ms, other frames are slow and PostLateUpdate.FinishFrameRendering() can take up to 23 ms or more. What is strange to me is that all sub functions scale the time they take when a slow frame happens So there's not a single thing that appears slow, I cannot figure out why.

    Any advice about how to debug this would be great!

    Here are a couple screen grabs from the profiler. These two frames happen one after the other and are rendering almost identical objects on screen.

    Screen Shot 2018-04-25 at 5.47.10 PM.png Screen Shot 2018-04-25 at 5.47.23 PM.png
     
    Ali_V_Quest likes this.
  2. rayliverified

    rayliverified

    Joined:
    Sep 14, 2015
    Posts:
    2
    I have this problem as well. PostLateUpdate.FinishFrameRendering is taking 50% of the total CPU usage.
     
    JakeSong and Ali_V_Quest like this.
  3. rayliverified

    rayliverified

    Joined:
    Sep 14, 2015
    Posts:
    2
    Ah of course, I forgot about setting 32-bit Display Buffer to off under Player Settings>Resolution and Presentation. Turning that off boosted my frame rates by 80 :)
     
  4. robrab2000-aa

    robrab2000-aa

    Joined:
    Feb 8, 2019
    Posts:
    117
    I'm getting this in webgl.. I can't see the 32bit display buffer setting in the player settings tho?
     
  5. anarcheril

    anarcheril

    Joined:
    Jan 8, 2013
    Posts:
    23
    Bump. Unity Version 2019.3.11f1
     
  6. Rickywild

    Rickywild

    Joined:
    May 20, 2015
    Posts:
    52
    The 32-bit Display Buffer check box isn't available in the latest versions of Unity. Your performance hit is now mandatory. I only noticed this because of lag in executable build and not within editor.

    Canvas.BuildBatch eating up CPU is a bug. Unity representative,
    "We applied a fix to 2020.1 and 2019.3, but it has caused problems which have not yet been fully diagnosed/fixed. Therefore we have delayed backporting the fix to 2018.4 until this other issue is resolved."

    So if you're in mid development, perhaps ignore this for time being until a stable fix has been released, otherwise following comment above, use the backport fix and attend to anything broken in engine version swap.

    See more here,
    https://forum.unity.com/threads/ui-...-buildbatch-depend-on-game-resolution.667846/

    For those stumbling upon this thread and are having performance issues due to canvas, check this post out,
    https://support.unity3d.com/hc/en-us/articles/115000355466-Split-canvas-for-dynamic-objects
     
    Last edited: May 15, 2020
    MikhailKavalenka likes this.
  7. n8dev_yt

    n8dev_yt

    Joined:
    Apr 14, 2020
    Posts:
    22
    what do you mean by "backport fix"? @Rickywild
     
  8. n8dev_yt

    n8dev_yt

    Joined:
    Apr 14, 2020
    Posts:
    22
    what do you mean @anarcheril ?
     
  9. SAZ_1

    SAZ_1

    Joined:
    Mar 26, 2013
    Posts:
    6
    late to this party ... and have the same issue ... apologies but I'm still unclear on what the fix for this is? ... switching back to an older version of Unity, I'm using 2020.1 and still seem to have the issue?
     
    Starsmiao and OneratGames like this.
  10. n8dev_yt

    n8dev_yt

    Joined:
    Apr 14, 2020
    Posts:
    22
    I unchecked use default resolution, and that fixed everything
     
  11. SAZ_1

    SAZ_1

    Joined:
    Mar 26, 2013
    Posts:
    6
    Thanks for replying :) ... still struggling, apologies for the noob question but where is this setting? do you mean default screen Width and Height?
     
  12. Starsmiao

    Starsmiao

    Joined:
    Aug 14, 2019
    Posts:
    10
    Hi,have you solved this problem?I have tried 2019.3~2019.4 and 2020.1,still having thie problem.
     
  13. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    I am getting the problem in webgl URP. any one has answer or commment?
     
  14. n8dev_yt

    n8dev_yt

    Joined:
    Apr 14, 2020
    Posts:
    22
    sorry, I'm just seeing this, it's in the player settings