I wonder if we start with tools/perf/metrics/smoothness.py --- this has the latency events and the frame drawn events in it, and is what we use for our current smoothness metrics.
This metric begins its life with a parsed version of an about:tracing recording, and an "interest range" --- a start and end time during which the page was doing the smooth thing.
For various reasons, it doesn't know that a fling or whatever was happening. I think those various reasons are good and I'd like to keep that separation.
So, with that in mind, two questions:
1) can we come up with a way to get a "time to first frame" by examining a trace to figure out what happened rather than having advance knowledge of what was happening? E.g. same code reports the right thing for a trace where there was (a) a fling, (b) a regular touch scroll, (c) a mouse scroll, and (d) javascript ran independent of input and eventually updated the screen.
2) for a given time range where only one user gesture ocurred, is there more than one "time to first X"? Or, is there just a "time to first frame"? E.g. you'd never have a scroll and a tap in the range. You can probably guess, I'd prefer one metric, maybe computed slightly differently depending on what is happening during the interval.
Note: 1d is important. Lets not forget it... time to first frame is valid for, e.g. chat windows that appear. :) Doing that one is ... tricky too, and possibly worth thinking through first: its constraints might shape a lot of the remaining thinking.
Any progress on this would be huge. Even a simplistic version of time to first frame that, for an active range, reported the time when the main thread frame's data made it up onto the compositor thread would be, even though not completely accurate, a HUGE step forward in terms of test coverage.
- N