You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: benchmarks/README.md
+30-5Lines changed: 30 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,18 @@ deterministic tests - such as those for render passes - can be run on any device
5
5
otherwise), but the benchmarks should be run on physical devices, or the closest approximation
6
6
to physical devices you can get.
7
7
8
-
## Baseline Profiles
8
+
There are two types of benchmarks:
9
+
10
+
-**Macro benchmarks** measure a particular flow in an entire app and are used to generate baseline
11
+
profiles. They're analogous to integration tests.
12
+
-**Micro benchmarks** measure a specific operation or set of small operations but running them
13
+
many times and collecting aggregate statistics. They're used to compare detailed performance of
14
+
competing implementations, detect specific performance regressions, and inform optimizations.
15
+
They're analogous to unit tests.
16
+
17
+
## Macro benchmarks
18
+
19
+
### Baseline Profiles
9
20
10
21
The sample apps can be used to extract 'baseline profiles' to improve code loading time after first
11
22
install. See [baseline profiles](https://developer.android.com/studio/profile/baselineprofiles).
@@ -36,7 +47,7 @@ This will create an output file separated by module and then also by package as
36
47
profile for each module can be added into its /src/main directory as `baseline-prof.txt`. Then on a
37
48
release build this will be included with the resulting APK/binary.
38
49
39
-
## dungeon-benchmark
50
+
###dungeon-benchmark
40
51
41
52
These are benchmarks for the [../samples/dungeon] app. Please instead use performance-poetry where
42
53
possible.
@@ -57,11 +68,11 @@ same scenario with and without forcing the use of the profiles. To force the use
57
68
`libs.androidx.profileinstaller` dependency is included into the app under profile (dungeon in this
58
69
case) for side-loading the profiles.
59
70
60
-
## performance-poetry
71
+
###performance-poetry
61
72
62
73
Module of code for performance testing related to poetry applications.
63
74
64
-
### complex-poetry
75
+
####complex-poetry
65
76
66
77
This application is a modified version of the samples/containers/app-poetry app which also uses the
67
78
common components in samples/containers/common and samples/containers/poetry. It modifies this
@@ -92,9 +103,23 @@ This module also includes a [robots package](performance-poetry/complex-poetry/s
92
103
that provides some utility helper 'robots' for the UiAutomator [androidx.test.uiautomator.UiDevice]
93
104
as well as scenarios specific to this Complex Poetry application.
94
105
95
-
### complex-benchmark
106
+
####complex-benchmark
96
107
97
108
This is an Android Test module which hosts an application that can run androidx.macrobenchmarks.
98
109
See the kdoc on [ComplexPoetryBenchmarks.](performance-poetry/complex-benchmark/src/main/java/com/squareup/benchmarks/performance/complex/poetry/benchmark/ComplexPoetryBenchmarks.kt)
99
110
100
111
The results for this are stored in the same folder at [ComplexPoetryResults.txt.](performance-poetry/complex-benchmark/src/main/java/com/squareup/benchmarks/performance/complex/poetry/benchmark/ComplexPoetryResults.txt)
112
+
113
+
## Micro benchmarks
114
+
115
+
### runtime-microbenchmark
116
+
117
+
This module contains benchmarks that measure the performance of the raw workflow runtime. To get
118
+
accurate results, these benchmarks must be ran on real physical devices, not emulators.
119
+
120
+
You can run them from the IDE like any other test (recommended), or with this command:
0 commit comments