Author Topic: Poor Scrollview Performance  (Read 177 times)

sb_007

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Poor Scrollview Performance
« on: November 26, 2017, 11:20:50 PM »
SCENARIO: Scrollview has 100+ elements. "Cull widgets while dragging them" box is "Checked".
Each element has 20 Labels (having Dynamic Font) with "Outline" (even without it, doesn't matter), 30 sprites, 2 buttons.
None of the item is "ANCHORED". And, only the Scrollview & Grid are anchored having "Execute" Condition set to "OnEnable".

ISSUE: FPS on this screen is just 29 & it drops from 30 to 6-7 while dragging. Performance Issue!

What Profiler says:
UIRect.Start() and UIRect.Update() shows 2500+ "Calls" in Profiler.
Fonts.CacheFontForText shows 5000 calls in Profiler.

STATS:
Batches = 39
Saved by batching = 0
Tris = 3.7k
Verts = 7.3k
SetPassCalls = 39

Kindly explain what could be done to improve the Performance.
« Last Edit: November 26, 2017, 11:42:43 PM by sb_007 »

batman2142

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Poor Scrollview Performance
« Reply #1 on: November 29, 2017, 01:31:26 AM »
If the elements in the ScrollView are all of the same type, using a UIWrapContent with about 6-7 items (the minimum required to fill the screen + maybe a half visible element) will improve performance a ton. Use the OnInitializeItem callback to set the element's contents like sprites,labels,etc using the realIndex parameter.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,137
  • Toronto, Canada
    • View Profile
Re: Poor Scrollview Performance
« Reply #2 on: November 29, 2017, 08:47:39 AM »
What's the point of making duplicate posts on the same issue? http://www.tasharen.com/forum/index.php?topic=15509.0