Abstract May 27 found that the hangar interface on the device has a noticeable lag, after the inspection found that Uispirte.update has an abnormal performance cost, as shown: Impact range for profile, the following profile code is added to the uisprite.update as follows: Conclusion: It is true that the interface is set to true! at each frame, and this part is the culprit of performance. Deactivate drop Acheivementui (Clone) after deactivate off Questpanelmoveroot after the remaining overhead uisprite basically scattered throughout the UI--chat, Countdownpanel The performance overhead is due to the fact that there are a large number of uisprite-formed update in the scene that has entered the upper branch of the IF, which has a large amount of data such as the vertex position. The reason for entering this branch is that Mchange is true, and this mchanged is intended to mark which controls have moved or performed any action that requires an update of the performance. However, when testing, there are no UI controls moving in the screen, and Achievementui is not even showing ... (In fact, the cause of the performance problem is because it is not shown, see the following article analysis) The only way to set Mchanged to False is (the call stack below):
- Uiwidget.updategeometry ()
- Uipanel.lateupdate ()
andThe UIPanel of Achievementui is disable, soUIPanel.Lateupdate will never be called, mchanged will never be set to false, so uisprite.update will always execute the overhead of the above conditional branch Conclusion performance problems are due to the fact that achievement, quest, and other parts of the UI control only disable UIPanel, but not deativate out gameobject. This practice does not match the hidden approach given in the official paradigm, and it is now possible to determine if the interface is not hidden according to Ngui's official recommendations, which can cause these performance problems.
From for notes (Wiz)
Disable Drop Ngui UIPanel will cause uisprite to incur abnormal overhead.