iOS development-measuring app startup time consuming

Source: Internet
Author: User
Cold start

Cold start is the process of starting from scratch after the app is killed. Hot Start

When the user presses the home button, the iOS app will not be killed immediately and will continue to survive for some time. Ideally, when the user clicks on the app icon and comes back, the app needs to do almost nothing to restore the status before exiting and continue to serve the user. This continuous survival scenario starts with the app called Hot start. Cold start specific heat start important

Apple's method of measuring startup time-consuming
Select Project→scheme→edit Scheme in the Xcode menu, then locate Run→environment variables→+ and add an environment variable named Dyld_print_statisticsvalue 1.

After the app runs:

before the main () function
A total of 52.27ms is used
Load Dynamic Library time consuming: 15.85ms
Pointer relocation time consuming: 5.68ms
OBJC class initialization time consuming: 7.10ms
Various initialization time consuming: 23.58ms

Of the three initialization costs, the maximum number of initialization is
Libsystem.b.dylib
Libbacktracerecording.dylib
Libmainthreadchecker.dylib
Modelio

after the main () function
From the main () function to the end of applicationwillfinishlaunching, we unify the part that is called after the main () function.
This example is to start the empty app, so this part is not time-consuming. In fact, many apps are optimized for this part of the startup time after the main () function.

Related Article

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.