text
stringlengths
1
372
access the tool from the landing page that appears once you have launched
DevTools (see installation instructions).
<topic_end>
<topic_start>
analysis tab
the analysis tab allows you to inspect a single snapshot
of size information. you can view the hierarchical structure
of the size data using the treemap and table,
and you can view code attribution data
(for example, why a piece of code is included in your compiled
application) using the dominator tree and call graph.
<topic_end>
<topic_start>
loading a size file
when you open the analysis tab, you’ll see instructions
to load an app size file. drag and drop an app size
file into the dialog, and click “analyze size”.
see generating size files below for information on
generating size files.
<topic_end>
<topic_start>
treemap and table
the treemap and table show the hierarchical data for your app’s size.
<topic_end>
<topic_start>
using the treemap
a treemap is a visualization for hierarchical data.
the space is broken up into rectangles,
where each rectangle is sized and ordered by some quantitative
variable (in this case, size in bytes).
the area of each rectangle is proportional to the size
the node occupies in the compiled application. inside
of each rectangle (call one a), there are additional
rectangles that exist one level deeper in the data
hierarchy (children of a).
to drill into a cell in the treemap, select the cell.
this re-roots the tree so that the selected cell becomes
the visual root of the treemap.
to navigate back, or up a level, use the breadcrumb
navigator at the top of the treemap.
<topic_end>
<topic_start>
dominator tree and call graph
this section of the page shows code size attribution data
(for example, why a piece of code is included in your
compiled application). this data is visible
in the form of a dominator tree as well as a call graph.
<topic_end>
<topic_start>
using the dominator tree
a dominator tree is a tree where each node’s
children are those nodes it immediately dominates.
a node a is said to “dominate” a node b if
every path to b must go through a.
to put it in context of app size analysis,
imagine package:a imports both package:b and package:c,
and both package:b and package:c import package:d.
in this example, package:a dominates package:d,
so the dominator tree for this data would look like:
this information is helpful for understanding why certain
pieces of code are present in your compiled application.
for example, if you are analyzing your app size and find
an unexpected package included in your compiled app, you can
use the dominator tree to trace the package to its root source.
<topic_end>
<topic_start>
using the call graph
a call graph provides similar information to the dominator
tree in regards to helping you understand why code exists
in a compiled application. however, instead of showing
the one-to-many dominant relationships between nodes of code
size data like the dominator tree, the call graph shows the many-to-many
relationships that existing between nodes of code size data.
again, using the following example:
the call graph for this data would link package:d
to its direct callers, package:b and package:c,
instead of its “dominator”, package:a.
this information is useful for understanding the
fine-grained dependencies of between pieces of your code
(packages, libraries, classes, functions).
<topic_end>
<topic_start>
should i use the dominator tree or the call graph?
use the dominator tree if you want to understand the
root cause for why a piece of code is included in your
application. use the call graph if you want to understand
all the call paths to and from a piece of code.
a dominator tree is an analysis or slice of call graph data,
where nodes are connected by “dominance” instead of
parent-child hierarchy. in the case where a parent node
dominates a child, the relationship in the call graph and the
dominator tree would be identical, but this is not always the case.
in the scenario where the call graph is complete
(an edge exists between every pair of nodes),
the dominator tree would show the that root is the
dominator for every node in the graph.
this is an example where the call graph would give
you a better understanding around why a piece of code is
included in your application.
<topic_end>