Figure: Diagnostic workflow: Locate changing UI → Separate layout/graphic work → Profile suitable canvas splits
Figure: Diagnostic workflow: Locate changing UI → Separate layout/graphic work → Profile suitable canvas splits

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

  1. Profile layout, graphic generation, and batch rebuilds independently.
    Inspect input targets in front
    Inspect input targets in front
  2. Split frequently changing UI from static UI and avoid redundant updates.
    Inspect input targets in front
    Inspect input targets in front
  3. Virtualize large lists and reduce chained layout recalculation.
    Inspect input targets in front
    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

  1. Separate text generation, layout and batch calculation in profiling.
    Change one variable, then remeasure
    Change one variable, then remeasure
  2. Avoid assigning unchanged values and reduce update/layout chains.
    Inspect input targets in front
    Inspect input targets in front
  3. Compare a dynamic child canvas against CPU, draw count and GPU costs.
    Inspect input targets in front
    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

References