Skip to content

Commit

Permalink
isolate speedline's trace sorting from LH
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny committed Jun 1, 2017
1 parent ce1cfd4 commit 8b281df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lighthouse-core/gather/computed/speedline.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ class Speedline extends ComputedArtifact {
// speedline() may throw without a promise, so we resolve immediately
// to get in a promise chain.
return computedArtifacts.requestTraceOfTab(trace).then(traceOfTab => {
// Use a shallow copy of traceEvents so speedline can sort as it pleases.
// See https://github.com/GoogleChrome/lighthouse/issues/2333
const traceEvents = trace.traceEvents.slice();
// Force use of nav start as reference point for speedline
// See https://github.com/GoogleChrome/lighthouse/issues/2095
const navStart = traceOfTab.timestamps.navigationStart * 1000;
return speedline(trace.traceEvents, {
return speedline(traceEvents, {
timeOrigin: navStart,
fastMode: true,
});
Expand Down

0 comments on commit 8b281df

Please sign in to comment.