apm application performance management (optimization of start / dropped frames Caton / power / memory leaks, etc.)

APM

 

First check all stages of time: (environment variable dyldPRINTSTATISTICS = 1 option)

 

1. Start optimization

        The key: find the cause and time-consuming

Total t = t1 (premain) + t1 (after the main)

t1:   premain

process:

1. First load executable file (a collection of all .o files)

2. Load dynamic link library (framework for all systems, such as UIKit, Foundation are all dynamic link library   methods integrated into the App)

tip: the benefits of a dynamic library:   . A only one in memory, all processes shared library system 

b. compared to static libraries, compilers, there is no need to break into

 

3. oc class loading / + load initialization method

optimization:

1. Do not decrease the framework

2. framework should be set to optional and required (all supported versions of iOS system)

3. oc merge or delete a class, clean up useless class, use Appcode check

                 4 deletion of unwanted static variables 

  5 deletion of useless waste method

  6 unnecessary to do things at + load methods to delay the + initialize

After the main (): t2 

process:

1. Initialize related services (tripartite libraries, etc.)

2. Display the Home (optimization is also centered on how quickly to do the show Home)

 

optimization:

1. The way the code is loaded Home view, do not xib

2. Asynchronous: network requests at start 

3. asynchronous: Initialize third-party service

 

 

  2. consumption

2.1 Energ Impact View Profile

2.2 detailed verification Instrument - Energy log   (see Code + Run mating catch timeProfile details)

optimization: 

a.cpu optimization, as far as possible the times cpu power consumption, minimize the use of timers

b. optimized network requests, and so reduce the length of the connection

. c targeting optimization   - close the

d detection hardware optimization.   - Accelerometer gyroscope it, close the

 

3. Memory Leak 

instrument- Leaks

4. The memory overhead

instrument - Acllocations detection memory usage / distribution

5. Processed (details of the operation codes)

instrument - time profile

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/daxueshan/p/11898266.html