- Home /
[NGUI performance] how to balance rendering batch vs UIPanel.LateUpdate ?
Hello.
I'm making full-2D game with full-NGUI for Android.
But there's some performance issue in game.
I used 'Deep Profiling' in unity editor, found there are delay in script.
The most time consume part is 'UIPanel.LateUpdate()'.
Following my architecture, using least UIPanels because performance reason that each UIPanel has it's own rendering batch.
The 'Deep Profiler' show me it's rendering batch count is 31, and UIPanel.LateUpdate time is 4.7ms
But my found solution tells me 'Don't change transform of UIWidget under UIPanel, and set UIPanel 'static'' : It can reduce UIPanel.LateUpdate().
So I changed each movable 2d object to have it's own UIPanel and make them static (of course don't change their children widget's transform).
In this case, profiler said 1.7ms for UIPanel.LateUpdate(), but rendering batch is 45.
I realized it is trade-off state.
So question is that :
What point is balanced architecture for optimized performance between number of UIPanel(drawcall) and time consume for UIPanel.LateUpdate()?
I can't make standard for it.
I know the answer can't be concret number or single word, but I want know-how.
for example : 45 drawcalls is ok. you can make panels until 100 drawcalls. Or, absolutely anytime decreasing drawcall count is important than UIPanel.LateUpdate, because that function is not that much time consume than profiler shows in real phone. Or there is a way exist same panel's depth tie up to one batch.
Please help me. or welcome discussion.
Your answer
![](https://koobas.hobune.stream/wayback/20220612180735im_/https://answers.unity.com/themes/thub/images/avi.jpg)