README
1The classes in this folder estimate the responsiveness of Chrome by measuring
2execution duration of individual work items on the UI and IO threads of the
3browser process.
4
5There are four types of work items executed on the UI and IO threads.
61) Both the UI and IO threads can have tasks posted to them via the Task
7 Scheduler [e.g. via base::PostTask with a BrowserThread::ID].
82) The UI thread processes native events directly from the message loop
9 [NSEvents on macOS, MSGs on Windows, InputEvents on Android, XEvents on
10 X11, etc.]
113) The IO thread's message pump processes IPCs by listening on data channels
12 [e.g. fds] and waking up on available data.
134) The UI thread's message loop may process other platform-specific sources.
14 This is currently not monitored because there is no consistent way to
15 instrument. If individual sources prove to be a source of non-responsiveness,
16 they will need to be addressed on a case-by-case basis.
17
18The classes in this folder do not monitor the queuing time of work items. The
19work to monitor this is tracked in https://crbug.com/1029137. This is how the
20queuing time of each work item type could be monitored:
21
221) Compute the delta between TimeTicks::Now() when the task starts execution and
23 |PendingTask::queue_time|. The queuing time of low priority tasks should
24 probably be ignored, since it can be long by design.
252) All native events have a creation timestamp which could be compared to
26 TimeTicks::Now() when the event starts execution. However, we have evidence
27 on Windows, macOS and Linux that the timestamp on native events is not
28 reliable. See https://crbug.com/859155#c39.
293) There's no good solution here, since the current wire format for IPCs does
30 not record the time at which the IPC was written to the data channel. The
31 time between reading from the data channel and finishing execution is
32 typically small, as heavy tasks are supposed to be dispatched off the IO
33 thread.
344) As explained above, individual sources should be investigated on a
35 case-by-case basis if they prove to be a source of non-responsiveness.
36
37Design doc: https://docs.google.com/document/d/1vDSGFvJblh7yJ3U3RVB_7qZLubyfTbQdQjuN1GoUNkc/edit
38