I'm using the UIScrollView component with too many item sliding on it (+200). The performance was not compatible for mobile so I have written a dynamic activater/disabler to work with UIScrollView. It activates the visible items and disables the ones that are outside of the clipping region. This method improved performance considerably but there is still some issue with items that have too many widgets on them. I tried to diagnose the root of the problem with profiling. Here are them;
Overall profiling:
The UIPanel.LateUpdate() and the UIScrollView.LateUpdate() are the main bottleneck points in the CPU. The UIScrollView's main calculations were about calculating widget bounds which I think it is for to restrict the items inside the panel. I doubt this can be evaded at all but if there is a fix for this I would really like to try it out. My main concern is with the UIPanel.LateUpdate().
UIPanel.FillAllDrawCalls():
Seems that the UIPanel is updating it's buffer, geometry and material on scroll slide. This seems to be one of the the main performance issue in the UIPanel.Update()
UIPanel.UpdateWidgets():
The other main performance issue on the UIPanel is because of the UIWidget.UpdateGeometry(). It seems as if the sprites on the widgets are getting rebuilded.
As far as I know the widgets do not get calculated if they are not getting translated in the world. In this case they are getting rebuilded but they are not the ones that are moving. The scrollview that is parenting them is moving (which has UIPanel on it) but somehow the widgets under it are getting rebuilded. Is there any way I can increase the scrollview's performance?