If I'm not mistaken, doesn't that mean there should always be a majority of 3 views with red dots
Your logic is good, but the document should not indicate a tree, but in a node. The hierarchy viewer tool4s function that you use to get these three points is Profile Node , and this will begin to profile the tree from the selected node (arbitrary tree root) to the end of the tree.
Each View , in the ViewGroup ( layouts based on the ViewGroup ), which contains more than the View, will have points, Otherwise, there are no points.
Thus, the comparison is made only at the node level, and not on the whole tree, and that is why you can get more than three red dots (one for measurement, one for layout, one for drawing) for all the tree, but not for node.
Secondly, I don’t see how these values can help improve performance given that these are relative values. There will always be half views faster than the other half.
The dots will help you find out which view inside the viewing group is the slowest to measure / layout / draw. To avoid freezing the screen, the total amount of operation should be lower than 16.6 ms (the android must support a frame rate of 60 frames per second).
The red dot will just give you a hint about what kind of profile you should have, but that does not mean that the presentation is not optimized, especially with a complex hierarchy with many children.
Also, if you need to create your own view, a hierarchy viewer can help you find out if you are performing fast rendering correctly.
I see visibility gone species that have little drawing time. Should I completely ignore the GONE views?
A View , which has the visibility set to GONE , will not go through onMeasure , onLayout and onDraw . You can easily try if you extend the widget like TextView and override these methods with Log.d to find out what will happen.
But I suppose that the time for the rally is because the presentation will be created, then attached to the window and, finally, change its appearance.
Example with TextView. First step: the object is created using the java public Text(Context context, AttributeSet attrs){...} constructor public Text(Context context, AttributeSet attrs){...} ), then the call to attach the window will be made using protected void onAttachedToWindow() {...} , and the visibility is changed using protected void onWindowVisibilityChanged(int visibility) {}
Now, if you want to debug more than your UI, try with a phone that has the Debug GPU Overdraw in the developer’s settings (not on all phones) or with an emulator. You can then see where the application overloads, and then optimizes your interface. Debugging GPU Overdraw firmware