Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Bug Disabled gameobjects are eating performance of PlayerUpdateCanvases

Discussion in 'UGUI & TextMesh Pro' started by fredholmsimon, Apr 20, 2023.

  1. fredholmsimon

    fredholmsimon

    Joined:
    Sep 5, 2020
    Posts:
    88
    I have ~20 menus loaded as child-canvases under a main canvas.
    If I disable the gameobject of each one of them, performance doesn't change.
    If I delete them, performance falls down to almost nothing.

    I can literally have a canvas with ONLY disabled child-objects and it's taking 2-3ms?
    After I delete the 19 disabled menus I get -> 0.05ms?

    Is this just how it's designed?
    How do I work around this.. :(

    I want to avoid loading/unloading menus from memory.

    - Screen-space camera
    - Pixel perfect -> OFF
    - 2020.3.42f1

    Very good computer, so the 2 ms seems small.. but it's not. Camera render is 2.5ms, game logic <1ms
     
  2. fredholmsimon

    fredholmsimon

    Joined:
    Sep 5, 2020
    Posts:
    88
    nvm, i'm an idiot

    edit: nvm, i'm not an idiot, i got receipts
     
    Last edited: Apr 20, 2023
  3. fredholmsimon

    fredholmsimon

    Joined:
    Sep 5, 2020
    Posts:
    88
    upload_2023-4-20_16-8-13.png upload_2023-4-20_16-11-38.png
    This is when I have a canvas with only disabled objects underneath.

    1ms



    upload_2023-4-20_16-7-21.png

    This is after deleting everything, and adding a small cube-image in the center.

    0.1ms
     

    Attached Files:

  4. fredholmsimon

    fredholmsimon

    Joined:
    Sep 5, 2020
    Posts:
    88
    this cannot be how it should work, something is still being processed in there, right?
     
  5. fredholmsimon

    fredholmsimon

    Joined:
    Sep 5, 2020
    Posts:
    88
    after further investigation, it seems not related to the amount of child-canvas, removing all canvases doesn't change anything.

    maybe the amount of objects?..
     
  6. fredholmsimon

    fredholmsimon

    Joined:
    Sep 5, 2020
    Posts:
    88
    it ONLY happens when I move my character, or while moving my aim (FPS Shooter), if not moving, and just standing still looking at a wall, there's no increase
     
  7. fredholmsimon

    fredholmsimon

    Joined:
    Sep 5, 2020
    Posts:
    88
    upload_2023-4-20_17-46-27.png
    what's happening in here.. deep profiling on
     
  8. Homicide

    Homicide

    Joined:
    Oct 11, 2012
    Posts:
    638
    Assuming the canvases are NOT childed to a dynamic object... Set the canvas and all its children to static, see what happens.
     
  9. fredholmsimon

    fredholmsimon

    Joined:
    Sep 5, 2020
    Posts:
    88
    no noticable difference :/
     
  10. icauroboros

    icauroboros

    Joined:
    Apr 30, 2021
    Posts:
    96
  11. fredholmsimon

    fredholmsimon

    Joined:
    Sep 5, 2020
    Posts:
    88
    > why there is a main canvas
    need to have for canvas-scaler compoentnt

    > Could you remove it and try again? Probably all canvases redraw because of parent canvas
    if you see my picture there's only ONE canvas, the parent canvas, issue remains

    and + the issue is not the canvas-scaler, i've tried with disabled/removed scaler too
     
  12. icauroboros

    icauroboros

    Joined:
    Apr 30, 2021
    Posts:
    96
    ...
     
  13. fredholmsimon

    fredholmsimon

    Joined:
    Sep 5, 2020
    Posts:
    88