Disable Drop Ngui UIPanel will cause uisprite to incur abnormal overhead.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.