Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tti): increase robustness of perf metrics #1947

Merged
merged 7 commits into from
Apr 3, 2017
Merged

Conversation

patrickhulce
Copy link
Collaborator

@patrickhulce patrickhulce commented Mar 31, 2017

First round of perf metric investigation, to be judged using #1936 :) Follow-up work includes adding in network reverse search methods for comparison.

  • Adds two additional TTI candidates that don't rely on visual completeness.
    • First 500ms window after fMP where 90th percentile EIL is <50ms
    • First 5000ms window after fMP where 90th percentile EIL is <50ms (if at the end of trace, uses a minimum window of as low as 1000ms)
  • Falls back to fMP when speedline fails to find screenshots in trace.
  • Adds timing data to trace-of-tab computed artifact.

patrickhulce and others added 3 commits March 31, 2017 10:24
- Adds two additional TTI candidates that don't rely on visual completeness.
	- First 500ms window after fMP where 90th percentile EIL is <50ms
	- First 5000ms window after fMP where 90th percentile EIL is <50ms (if at the end of trace, uses a minimum window of up to 1000ms)
- Falls back to fMP when speedline fails to find screenshots in trace.
- Adds timing data to trace-of-tab computed artifact.
@@ -44,9 +44,9 @@ class EstimatedInputLatency extends Audit {
};
}

static calculate(speedline, model, trace) {
static calculate(tabTrace, model, trace) {
// Use speedline's first paint as start of range for input latency check.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

estLatency: estLatency,
startTime: startTime.toFixed(1)
});
const times = {fmpTiming, visuallyReadyTiming, endOfTraceTime};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you put a lastTraceEvtTs into trace-of-tab?

const traceEndTsInMS = trace.traceEvents.reduce(
          (acc, traceEvent) => Math.max(acc, traceEvent.ts), 0) / 1000;

it's from will's https://github.com/GoogleChrome/lighthouse/pull/1936/files#diff-fd99fc8068c6555d1fb3d1c70df7c29cR82

wec can then reuse here (and maybe drop the traceviewer dep) and also in will's #1936

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, but naming traceEnd :) to match with event names :)

@@ -37,8 +37,8 @@ describe('Performance: estimated-input-latency audit', () => {
const artifacts = generateArtifactsWithTrace({traceEvents: pwaTrace});
return Audit.audit(artifacts).then(output => {
assert.equal(output.debugString, undefined);
assert.equal(output.rawValue, 17.4);
assert.equal(output.displayValue, '17.4ms');
assert.equal(output.rawValue, 16.7);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be clear, these changes are only due to the shift from speedline.first to FMP. yes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

const timings = {};

Object.keys(metrics).forEach(metric => {
timings[metric + 'Ts'] = metrics[metric] && metrics[metric].ts / 1000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the structure of the extInfo objects in TTI/FMP includes both a timings object and a timestamps object. should we do the same here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm


Object.keys(metrics).forEach(metric => {
timings[metric + 'Ts'] = metrics[metric] && metrics[metric].ts / 1000;
timings[metric] = timings[metric + 'Ts'] - timings.navigationStartTs;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding this guy in here means that if we pass along the data in extInfo then tools like pwmetrics could skip this work: https://github.com/paulirish/pwmetrics/blob/master/lib/metrics.ts#L54-L61

*/
static findTTIAlpha(times, data) {
return TTIMetric._forwardWindowTTI(
Math.max(times.fmpTiming, times.visuallyReadyTiming),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment here to clarify you are using fmp as fallback?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -63,9 +63,6 @@ class TTIMetric extends Audit {
return {currentLatency, foundLatencies};
}

// Clip to the trace end
endTime = Math.min(endTime, maxTime);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm! why'd you nuke this?

fwiw: https://docs.google.com/document/d/1b9slyaB9yho91YTOkAQfpCdULFkZM9LqsipcX3t7He8/edit#heading=h.ooalxriljq1i has details on the clipping approach for EIL

cc @brendankenny

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I added this when I did the 5000ms - 1000ms if we reached the end of trace for WPT TTI, but after our convo on Friday about how fake that is I nuked the variable window and just kept the 5 seconds so it wasn't necessary anymore

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha. ok

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want to update pwmetrics-events so we can get these new TTIs plotted in the trace?

image

@patrickhulce
Copy link
Collaborator Author

want to update pwmetrics-events so we can get these new TTIs plotted in the trace?

done

image

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ace. lets do it.

@paulirish paulirish merged commit 1eea2a3 into master Apr 3, 2017
@paulirish paulirish deleted the competing_ttis branch April 3, 2017 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants