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

misc: simplifications in simulator/connection-pool #7894

Merged
merged 2 commits into from Apr 2, 2019
Merged

Conversation

brendankenny
Copy link
Member

another one I accumulated while stepping through the simulator. Feel free to reject anything @patrickhulce :)

  1. remove records from LH.Artifacts.NetworkAnalysis. The caller of the computed artifact has to already have them to get the NetworkAnalysis, and we never use them on any instance of the type anyways.

  2. early return in PageDependencyGraph.linkNetworkNodes() for the common case where there were no redirects of a particular record

  3. split ConnectionPool.acquire() into the case where a connection is needed to fetch a record and the case where a connection is already fetching a record.

    This seems ok as a place where the generality hasn't proven necessary...we only call acquire() in three places, and the two done that return assigned connections already explicitly call out with a comment and a type cast that it knows a connection already exists for this record.

  4. removed NodeTimingIntermediate.queuedTime as it isn't used for anything. I can add back if this was useful for debugging or something.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

LGTM other than the queuedTime :)

const observedConnectionWasReused = !!this._connectionReusedByRequestId.get(record.requestId);
/** @type {TcpConnection[]} */
Copy link
Collaborator

Choose a reason for hiding this comment

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

this isn't necessary anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

this isn't necessary anymore?

no, its inferred from the first part of the init and the _findAvailableConnectionWithLargestCongestionWindow callsite

*/
_markNodeAsReadyToStart(node, queuedTime) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer to keep this, it's pretty helpful when stepping through the debugger

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer to keep this, it's pretty helpful when stepping through the debugger

gotcha :)

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -503,7 +501,7 @@ module.exports = Simulator;
* @typedef NodeTimingIntermediate
* @property {number} [startTime]
* @property {number} [endTime]
* @property {number} [queuedTime]
* @property {number} [queuedTime] Helpful for debugging.
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@patrickhulce patrickhulce merged commit b8ac221 into master Apr 2, 2019
@patrickhulce patrickhulce deleted the simconn branch April 2, 2019 19:51
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