"Android" Development optimization--tuning tool: Trackview,method Profiling

Source: Internet
Author: User

The tool TrackView that comes with the Android SDK is located in the Tools directory of the SDK. To use: Go to Tools and run

TraceView E:\loginActivityTracing.trace

Can. How did the trace file build?


There are two ways of generating

1, use code generation, want to tune which tune.

You only need to call where it needs to be called.

Debug.startmethodtracing ("loginactivitytracing");

And where the end call is called

Debug.stopmethodtracing ();

The Loginactivitytracing.trace file is generated in the root directory of the SD card.


2, no code, you can use DDMS to generate.



This is the start, and then the same button is clicked again to generate the. trace file and open it.




After execution, you can see a picture like this:



traceview interface information
TraceView interface includes time Panel and method panel
(1) Time Panel (Timeline panel)
The time panel shows the execution of each thread, where [1]main] is the UI main thread.
Move to a location to see the execution information for the method that corresponds to that point, and click the method panel to select the appropriate method.
can be left-click and hold the selected area to enlarge the local fine view, different methods with different colors


 


(2) Method Panel (profile Panel)
Method panel shows the execution of all methods. Click a method to view the execution time area on the corresponding thread and display its parent and child methods.
Each method includes the following columns of information that can be sorted by clicking on a column to determine the function that produces the performance problem:
Incl CPU time, EXCL CPU time, incl real time, Excl real time, incl CPU time%, EXCL CPU time%, incl Real time%, Excl real time%, calls+recurcalls/total, CPU time/call, real Time/call
All time is computed in milliseconds. The specific meanings and functions of each column are as follows:
A. Incl means that all child functions are time-consuming and also counted, and excl means that the call times of the child functions are not included. Comparisons can determine whether the time-consuming operation occurs in itself or in a child function.
B. The CPU time indicates the amount of CPU times that are consumed, and Real time includes CPU times and waiting, switching, and so on, so it is generally larger than the CPU. Comparisons can determine if the time-consuming operation is within the CPU execution segment.
C. The% of the above four indicators indicates the percentage of the function in total time. Easy to see the time ratio of a function.
D. calls+recurcalls/total represents the number of external calls + recursion count/total number of times. You can see if the number of calls matches your expectations.
E. CPU Time/call, real time/call represents the ratio of total CPU time and real time to the total number of calls. Looking at the time-consuming of each invocation, it is generally possible to determine the performance of each function by simply doing so.



"Android" Development optimization--tuning tool: Trackview,method Profiling

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.