Search Unity

Performance spikes on Canvas.BuildBatch and UIEvents.WillRenderCanvases

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by TheBullet, Jul 2, 2019.

  1. TheBullet

    TheBullet

    Joined:
    Mar 1, 2016
    Posts:
    28
    Hello, we're having performance problems with UIEvents.WillRenderCanvases and Canvas.BuildBatch.

    It only happens in build version and when the camera is moving. There aren't spikes if the camera is static.

    PlayerUpdateCanvasesSpikes.jpg

    We are having this problem since we updated the project to 2019.1.8, in the last version we used (2017.3.1p1) the game was running fine.

    I'm trying to find out what is causing it but I can't find a solution. With this issue the game is not playable and we can't update the public build until we fix it.

    Does anyone have any clue of what could be happening?

    Thanks!
     
  2. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    31
    Does this look like a regression of issue ID

    926629

    ?
     
  3. autumn_737

    autumn_737

    Joined:
    Jul 23, 2012
    Posts:
    14
    I'm having this issue in 2018.4.7.f1.
    According to the issue tracker, hasn't been fixed for anything beyond 2018.1
     
  4. maormenashe

    maormenashe

    Joined:
    Oct 7, 2018
    Posts:
    16
    I used to have a similar problem. I read about the building of the canvas and i found out that on every movement the canvas renders everything. "The problem is that, when one or more elements change on a Canvas, the whole Canvas has to be re-analyzed to figure out how to optimally draw its elements." (That includes the positioning by the camera)
    I'd recommend you read here about some UI optimization tips.
    I hope this helps.
     
    jamespaterson likes this.
  5. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,189
    There is a bug in 2018 and 2019 causing a stall on this profile marker. We are working on a fix. Thanks for your patience.
     
    jamespaterson likes this.
  6. aneatperson

    aneatperson

    Joined:
    May 15, 2019
    Posts:
    1
    Can you provide additional information on the bug, such as an issuetracker link? I'm also seeing this issue and would like to understand if I need to wait for this fix or if there is some kind of work-around/change I can make to alleviate the stall.
     
  7. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,189
    Sure, here it is: https://issuetracker.unity3d.com/is...-causes-a-slow-editor-when-entering-play-mode

    The info on that page doesn’t mention that it occurs in 2018.4 and 2019.1 too, but it does.

    I don’t know of any workarounds for it at this time, unfortunately.

    EDIT: There is this one too: https://issuetracker.unity3d.com/is...ouse-from-unity-window-to-any-other-os-window
     
    Last edited: Oct 11, 2019