What Are the Main Performance Bottlenecks in Unity UGUI?
If your mobile game's UI is causing frame drops or device overheating, you're not alone. UGUI performance is one of the most common pain points in mobile game development, and the root cause is often hidden in details that are easy to overlook. Before you can optimize, you need to understand where UI cost actually comes from. This section breaks down the two core dimensions of UGUI performance—rendering and logic—so you can quickly identify which area is dragging your project down.
Two Key Dimensions of UI Performance UI performance cost in UGUI falls into two broad categories: rendering and logic. Each category contains specific bottlenecks that developers need to watch for. Rendering Cost What Is DrawCall? DrawCall is mainly processed on the CPU side. When the UI generates a high DrawCall count, it directly contributes to high CPU usage. Each time Unity issues a draw command to the GPU, a certain amount of CPU overhead is involved in setting up render state, passing parameters, and submitting the command. In practice, the DrawCall count can usually be kept below 30 for most UIs. Even for a complex MMO style interface—with character info in the upper left, quests in the middle left, a virtual joystick in the lower left, inventory icons and buttons on the right, quest prompts in the middle right, skill buttons in the lower right, and a chat box at the bottom center—such a complex interface can still be kept under 30 Draw Calls. During combat, UGUI DrawCall can even be reduced to single digits. This is the target range for DrawCall control. If a full screen UI does not need to render the 3D scene behind it, the DrawCall budget can be slightly relaxed. However, if the UI must be composited with the scene, the UI DrawCall count should still be minimized. Since most UI panels are translucent—especially in games with a high tech visual style where the scene behind must remain visible—reducing DrawCall remains important. What Is Overdraw? Overdraw can be understood as the amount of screen area that the UI occupies more than once. Placing an image or a button on the screen contributes to Overdraw. Every pixel that is drawn multiple times wastes GPU fill rate. The general rule is: only necessary elements should be visible on screen. Many development teams waste a considerable amount of performance on both DrawCall and Overdraw, often without realizing it. Logic Cost In UGUI, logic cost is mainly concentrated in three functions: 1. EventSystem.Update This is the cost of the event system, which has two components. Event detection : Every frame, Unity traverses and checks which UI elements intersect with the current touch points. If an intersection is found, the corresponding event is triggered. The whole process involves relatively complex traversal. If the UI supports interaction, all interactive UI elements must be traversed when the screen is tapped in order to locate the target. Although a typical UI usually contains only hundreds of elements, this area should still be optimized where possible. Event triggered logic : For example, when a button is clicked, the logic inside the button's onClick callback is also included in this function, although this part is not directly related to the UI system itself. 2. Canvas.SendWillRenderCanvases This function recalculates the vertex data for all updated UI elements. From the moment a UI element is updated to the point where it is finally rendered, a set of arrays stores its vertex attributes—including positions, UVs, and other properties—in C arrays. When text or similar content changes, the vertices must be recalculated because different text occupies different quad vertex positions. Whenever related properties are modified, these arrays need to be updated. This is pure C work and is included in . After the vertex data has been calculated and the arrays have been updated, the data must be passed into a Mesh because rendering must go through meshes. This transfer process is also completed inside . 3. Canvas.BuildBatch / BatchJob After completes, each UI element has its vertex data and part of its mesh shape and attributes. However, at this stage, each UI element still has an independent mesh and cannot be drawn one by one directly—otherwise the DrawCall count would be extremely high. This is where batching comes in. combines the small meshes of individual UI elements into larger meshes. The batching process involves many complex calculations, such as: Whether each element uses the same atlas a large texture formed by packing multiple small images Whether it uses a special material Its order in the scene hierarchy Its rendering order Only adjacent elements can be batched. If two elements do not overlap, Unity may also consider whether to adjust the rendering order so that more elements using the same atlas can be batched together. As a result, the batching process also has a non trivial cost. The positive side is that a large portion of BatchJobs can run on worker threads. Summary In summary, UI performance cost is mainly concentrated in two broad areas: rendering and logic. Rendering side : the key issues are DrawCall and Overdraw Logic side : the key areas are the three functions described above In practice, except for , which is relatively less likely to become a problem, DrawCall and Overdraw on the rendering side, as well as and on the logic side, are all common sources of performance bottlenecks.