Performance optimization-Caton detection tool

Performance optimization-Caton detection tool

Stuttering is divided into two types: one is frame drop and the other is ANR. The android system maintains a refresh rate of 60 frames per second. If our interface is lower than this number of frames, we can determine that the freeze has occurred (frame dropped).

The interface refresh is mainly divided into three steps:

 1 CPU  UI 
 2 OpenGL  DisplayList 
 3 GPU 
 

Aspectj

 AOP &  &  class 
  & 
 

Matrix

  
 

BlockCanary principle

  Looper.loop Printer handler log log BlockCanary Looper Printer & ANR &CPU 
 public static void loop() {
         ...
        final Printer logging = me.mLogging;
        if (logging != null) {
            logging.println(">>>>> Dispatching to " + msg.target + " " +
                    msg.callback + ": " + msg.what);
        }
        try {
            msg.target.dispatchMessage(msg);
            dispatchEnd = needEndTime ? SystemClock.uptimeMillis() : 0;
        } finally {
            if (traceTag != 0) {
                Trace.traceEnd(traceTag);
            }
        }
        if (logging != null) {
            logging.println("<<<<< Finished to " + msg.target + " " + msg.callback);
        }

       ...
    }

  : dispatchMessage