Cause and mechanism
A Canvas groups uGUI images and text for rendering. Changing UI can rebuild a Graphic's geometry or recalculate how the Canvas batches drawing. Identify frequently changing UI and inspect its update time in the Profiler. A change does not necessarily recreate every UI element's vertices from scratch.
Check and correct the setup
- Profile layout, graphic generation, and batch rebuilds independently.
Inspect input targets in front - Split frequently changing UI from static UI and avoid redundant updates.
Inspect input targets in front - Virtualize large lists and reduce chained layout recalculation.
Inspect input targets in front
Limits and verification
Canvas splits can increase draws. Compare CPU time and batches; inspect GPU overdraw separately.
A focused diagnostic setup
Place a static background and one changing number on a canvas. Compare updates disabled/enabled and a child-canvas split.
Test in this order
- Separate text generation, layout and batch calculation in profiling.
Change one variable, then remeasure - Avoid assigning unchanged values and reduce update/layout chains.
Inspect input targets in front - Compare a dynamic child canvas against CPU, draw count and GPU costs.
Inspect input targets in front
Interpret the result
Splitting can help batch recalculation but leaves expensive text generation. Virtualize large lists too. Partition by actual changes rather than creating one canvas per element.
Related explanations
- UI position or size resets: resolve Layout Group and RectTransform conflicts
- Reduce UI overdraw coverage and GPU time