Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ScrollView & TextMeshProUGUI performance

Discussion in 'UGUI & TextMesh Pro' started by MartinAnd, Dec 9, 2019.

  1. MartinAnd

    MartinAnd

    Joined:
    Jan 11, 2018
    Posts:
    5
    Hello,

    In my App i have a MainMenu scene with one Canvas including a CanvasScaler.
    This Canvas contains 6 GameObject. Every Gameobject contains a ScrollView with a TextMeshProUGUI (incl. a Content Size Fitter) as Content. The Text in each TextMesh has about 13 000 Characters.

    All 6 GameObjects are set separately active through a ToggleGroup.

    But Switching between these GameObjects takes between 300 and 500ms. So it takes a noticeable amount of time between touching the Button and see the Text.
    This is unusable for navigating through an App.

    How can i improve the performance? What did i forget/miss?

    I am using Unity 2018.4.6f1.

    This is the Profile window:
    upload_2019-12-9_10-3-25.png

    Here with Deep Profile:
    upload_2019-12-9_10-3-15.png

    Also the GC Alloc with 110MB seems quiet high, only for Text...

    This is how the menu looks like:
    upload_2019-12-9_10-3-0.png

    Thanks in advance, for your help.

    Regards Martin
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you provide me with a repro project to take a closer look at this?

    You can either provide this via the Unity bug reporter and include the project or alternatively send me a PM with link to download the repro project.

    P.S. Depending on how these Scrollviews are setup. More specifically if the RectTransforms are using Stretch mode and potential values, it is possible (due to rounding errors) that OnRectTransfromDimensonChanged() is triggered as you scroll which technically should not happen. This can lead to a full re-layout of the hierarchy / canvas and significant performance overhead.