OLD | NEW |
---|---|
(Empty) | |
1 # Memory Benchmarks | |
2 | |
3 This document describes benchmarks available to track Chrome's and | |
4 WebView's memory usage, where they live, what they measure, how to run them, | |
5 and on how to diagnose regressions. | |
6 | |
7 [TOC] | |
8 | |
9 ## Benchmarks | |
Primiano Tucci (use gerrit)
2017/01/06 17:29:33
Before this I'd add a very small recap of the form
perezju
2017/01/09 17:01:46
Done.
| |
10 | |
11 Benchmarks are implemented in [Telemetry][] and measurements are gathered via | |
12 [memory-infra][] metrics. | |
13 | |
14 The most important benchmarks are: | |
15 | |
16 * [system_health.memory_mobile][system_health] - collection of | |
17 user scenarios on mobile Android devices. | |
18 * [system_health.memory_desktop][system_health] - collection of | |
19 user scenarios on desktop platforms. | |
20 | |
21 Other benchmarks maintained by the memory-infra team are: | |
Primiano Tucci (use gerrit)
2017/01/06 17:29:33
This one I'd put in an appendix, like:
"There are
perezju
2017/01/09 17:01:46
Done.
| |
22 | |
23 * [memory.dual_browser_test][memory_py] - cycle between doing Google searches | |
24 on a webview-based browser (a stand-in for the Google Search app) and | |
25 loading pages on Chrome. Runs on Android devices only. | |
26 * [memory.long_running_dual_browser_test][memory_py] - same as above, but the | |
27 test is run for 60 iterations keeping both browsers alive for the whole | |
28 duration of the test. Last-resort net to catch memory leaks not apparent on | |
29 shorter tests. | |
30 * [memory.top_10_mobile][memory_py] - cycle between loading a page on Chrome, | |
31 pushing the browser to the background, and then back to the foreground. | |
32 *To be deprecated in favor of system_health.memory_mobile.* | |
33 * [memory.top_10_mobile_stress][memory_py] - same as above, but keeps a single | |
34 instance of the browser open for 5 repetitions. *To be deprecated.* | |
35 | |
36 [Telemetry]: https://github.com/catapult-project/catapult/blob/master/telemetry/ README.md | |
37 [memory-infra]: /memory-infra/README.md | |
38 [system_health]: https://chromium.googlesource.com/chromium/src/+/master/tools/p erf/page_sets/system_health/ | |
39 [memory_py]: https://chromium.googlesource.com/chromium/src/+/master/tools/perf/ benchmarks/memory.py | |
40 | |
41 ## What is measured | |
Primiano Tucci (use gerrit)
2017/01/06 17:29:33
Before getting here, I think there should be a sec
perezju
2017/01/09 17:01:46
Done.
| |
42 | |
43 These benchmarks are run continuously on the [chromium.perf][] waterfall, | |
Primiano Tucci (use gerrit)
2017/01/06 17:29:33
Move these 4 lines up when you say "the most impor
perezju
2017/01/09 17:01:46
Done.
| |
44 collecting and reporting results on the | |
45 [Chrome Performance Dashboard][chromeperf]. | |
46 | |
47 [chromium.perf]: https://build.chromium.org/p/chromium.perf/waterfall | |
48 [chromeperf]: https://chromeperf.appspot.com/report | |
49 | |
50  | |
51 | |
52 To view data from one of the benchmarks you should select: | |
Primiano Tucci (use gerrit)
2017/01/06 17:29:33
This should be a section called:
# How to interpre
perezju
2017/01/09 17:01:46
This is now a section "Understanding memory metric
| |
53 | |
54 * **Test suite:** One of the [benchmarks](#Benchmarks) named above. | |
55 * **Bot:** A particular platform or device configuration. (Sign in to also | |
56 see internal bots.) | |
57 * **Subtest (1):** A *metric name* of the form | |
58 `memory:{browser}:{processes}:{source}:{component}:{kind}_avg` | |
59 where: | |
60 * **browser:** One of `chrome` or `webview`. | |
61 * **processess:** One of `browser_process`, `renderer_processess`, | |
62 `gpu_process`, or `all_processess`. | |
63 * **source:** One of `reported_by_chrome` or `reported_by_os` | |
64 * **component:** May be a Chrome component, e.g. `skia` or `sqlite`; | |
65 details about a specific component, e.g. `v8:heap`; or a class of memory | |
66 as seen by the OS, e.g. `system_memory:native_heap` or `gpu_memory`. | |
67 * **kind:** The kind of memory being reported. For metrics reported by | |
68 Chrome this usually is `effective_size` (others are `locked_size` | |
69 and `allocated_objects_size`); for metrics by the OS this usually is | |
70 `proportional_resident_size` (others are `peak_resident_size` and | |
71 `private_dirty_size`). | |
72 * **Subtest (2):** The name of a *story group*. | |
73 * On system health benchmarks it consists of the first two parts, | |
74 i.e. `{action}:{category}`, of the story name (see below). | |
75 * On dual browser benchmarks it is either `on_chrome` or `on_webview` | |
76 indicating which of the two browsers was on foreground at the time of | |
77 measurement. | |
78 * On top 10 mobile benchmarks it is either `foreground` or `background` | |
79 indicating the state of the browser at the time of measurement. | |
80 * **Subtest (3):** The name of a *story*. | |
81 * On system health benchmarks these are of the form | |
82 `{action}:{category}:{site}`. Categories are things like `news`, | |
83 `social`, `tools`, etc. Sites are identified by a short name like | |
84 `cnn`, `facebook`, `gmail`, etc. The action identifies interactions | |
85 performed with the page: | |
86 * `load:*` stories just navigate to a URL, wait for the page to | |
87 load, and take a memory measurement. | |
88 * `browse:*` stories navigate to a URL, interact with the page (e.g. | |
89 scroll, click on elements, navigate to subpages, navigate back), | |
90 and take a single memory measurement in the end. | |
91 * `background:*` stories navigate to a URL, may interact with the | |
92 page, push the browser to the background, and then take a memory | |
93 measurement. | |
94 * `long_running:*` stories interact with a page for a longer period | |
95 of time (~ 5 mins each) before taking a memory measurement. | |
96 * `blank:about:blank` takes a single memory measurement on | |
97 **about:blank**. | |
98 | |
99 ## How to run the benchmarks | |
100 | |
101 Benchmarks may be run on a local platform/device or remotely on a try job. | |
102 | |
103 ### How to run locally | |
104 | |
105 After building, e.g. `ChromePublic.apk`, you can run a specific system health | |
106 story with the command: | |
107 | |
108 ``` | |
109 $SRC/tools/perf/run_benchmark run system_health.memory_mobile \ | |
110 --browser android-chromium --story-filter load:search:google | |
111 ``` | |
112 | |
113 This will run the story with a default of 3 repetitions and produce a | |
114 `results.html` file comparing results from this and any previous benchmark | |
115 runs. | |
116 | |
117  | |
118 | |
119 Other available options are: | |
120 | |
121 * `--pageset-repeat [n]` - override the default number of repetitions | |
122 * `--output-format html --output-format json` - select *both* output formats | |
123 to get individual [trace files][memory-infra] in addition to the | |
124 `results.html` file. | |
125 * `--reset-results` - clear results from any previous benchmark runs in the | |
126 `results.html` file. | |
127 * `--results-label [label]` - give meaningful names to your benchmark runs | |
128 to make it easier to compare them. | |
129 | |
130 To test WebView make sure to [replace the existing webview][webview_install] | |
131 on the device and select `--browser android-webview`. | |
132 | |
133 [webview_install]: https://www.chromium.org/developers/how-tos/build-instruction s-android-webview | |
134 | |
135 ### How to run a try job | |
136 | |
137 Given a patch on a chromium checkout, try jobs provide a convenient way to | |
138 evaluate its memory implications on devices or platforms which | |
139 may not be immediately available to developers. | |
140 | |
141 To start a try job [upload a CL][contributing] and run the command, e.g.: | |
142 | |
143 ``` | |
144 $SRC/tools/perf/run_benchmark try android-nexus5 system_health.memory_mobile | |
145 ``` | |
146 | |
147 This will run all of the system health stories for you, and conveniently | |
148 provide a `results.html` file comparing measurements with/without your patch. | |
149 | |
150 To see the full list of available try bots run the command: | |
151 | |
152 ``` | |
153 $SRC/tools/perf/run_benchmark try list | |
154 ``` | |
155 | |
156 [contributing]: https://www.chromium.org/developers/contributing-code | |
OLD | NEW |