-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core(driver): deliver trace as events rather than a stream #6056
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can drop the _readTraceFromStream
method too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % brendan's thing
lighthouse-core/gather/driver.js
Outdated
|
||
// Issue the command to stop tracing. | ||
return this.sendCommand('Tracing.end').catch(reject); | ||
// setup listener for when a trace bundle is sent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"trace chunk" but yeah. How about "// dataCollected events fire for each trace chunk, in order"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed, see if u like it.
|
||
return this.sendCommand('IO.read', readArguments).then(onChunkRead); | ||
}; | ||
this.once('Tracing.tracingComplete', _ => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so. much. easier. :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
🐎🏎🚤🏃💨
Summary
This changes the Tracing.start protocol command to use the
ReportEvents
transferMode instead ofReturnAsStream
. This makes the trace gathering much faster, as observed in some automated run timings:Note: timings are averages of 5 seperate runs with each method.
Related Issues/PRs
fixes #5968
closes #5939
Based on code in old driver implementation