Search Unity

Unity UI UGUI Using 98% of CPU?!

Discussion in 'UGUI & TextMesh Pro' started by HittmanA, Sep 10, 2017.

  1. HittmanA

    HittmanA

    Joined:
    Jul 27, 2016
    Posts:
    45
    I have a fairly simple scene. It is a plane as the floor (for testing) and an Adventure Creator character and MadGoat-SSAA for anti-aliasing. When I run the game, however, I get horrible performance. At only 2x FSSAA I get 3FPS and using the profiler, I find that somehow UGUI is using 98% of the CPU. The problem appears to be "Unaccounted time between: Start of frame and UGUI.Rendering.EmitWorldScreenspaceCameraGeometry (Picture for reference: ). The problem is also not limited to the editor. If I build the game as a Mac standalone I get the same terrible performance. Why is this and how can it be fixed?
     

    Attached Files:

  2. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
  3. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    I also confirmed that it's not happening on my PC.
     
  4. ilmario

    ilmario

    Joined:
    Feb 16, 2015
    Posts:
    71
    Me too. Could be connected to some canvas being in world space.
     
  5. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    FYI - I noticed something strange on the Mac--when Unity is running, Spotlight search seems to be chewing up processor cycles--2 cpu's worth (4 mdworkers + mds + mds_stores. )
     
  6. ironoak

    ironoak

    Joined:
    Sep 22, 2016
    Posts:
    7
    We are also seeing something similar this after upgrading to 2017.2.
     

    Attached Files:

  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    According to the screenshot, it seems to be the known "UGUI.Rendering.UpdateBatches" performance regression:
    https://forum.unity.com/threads/ugu...s-performance-regression-continuation.501780/

    It's already fixed in 2017.3 beta. The fix is going to be ported to 2017.2 and will ship via patch release first.

    If it's a different method that is causing the performance issue, I recommend to submit a bug-report.
     
  8. ironoak

    ironoak

    Joined:
    Sep 22, 2016
    Posts:
    7
  9. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    Since upgrading from Unity 5.x to 2017.2 I see the same thing in *all* my projects, no matter if Arch Viz stuff or space games or whatever.

    See attached screenshot. There are crazy spikes of 500-900 ms, which is a bit crazy on a CustoMac with a i7-7700K and a GTX 1070. First I thought it is the culling, but in my ArchViz projects culling is deactivated on the camera.

    Then I thought it is UGUI (as suggested by the profiler, see attached screenshot), but there are *zero* UGUI elements in my scene. This is on the Mac version, editor and builds. I have not tried Windows yet, but I will.
     

    Attached Files:

    Last edited: Nov 25, 2017
  10. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    Just like the poster here reports, there seems to be a correlation between "Unaccounted time between: Start of Frame and UGUI.Rendering.EmitWorldScreenspaceCameraGeometry" and "Gfx.ProcessCommands", as seen in the Timeline of the Profiler. See attached screenshot.
     

    Attached Files:

  11. DanJa512

    DanJa512

    Joined:
    Dec 14, 2015
    Posts:
    18
    I had this issue in a project where it would only show up on my Mac -- running in editor on Windows was fine. It turned out that the skybox textures I was using were not playing nice with Mac. I didn't look any further into it, just used a different skybox.
     
  12. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    Please submit a bug-report to allow Unity Technologies to fix/replace the "Unaccounted time between..." entry with the actual thing that is causing it. That way, we get better profiling reports in future versions of Unity at least.
     
    Last edited: Nov 26, 2017