Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5843 Investigate socket write performance
  3. NODE-5928

Consolidate connection signal access and limit adding event listeners

    • Type: Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.4.0
    • Affects Version/s: None
    • Component/s: None
    • 0
    • Not Needed
    • Hide

      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.

      Show
      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Use Case

      As a Node.js engineer
      I want to improve the performance of the socketWrite function on our Connection class
      So that the driver continues to operate with the same performance prior to the async connection layer change.

      User Impact

      • None

      Dependencies

      • None

      Unknowns

      • Should we remove signal use from the connection layer?
        • No, I think that can be something we consider post-CSOT, this change will avoid the issues with accessing signal repeatedly

      Acceptance Criteria

      Implementation Requirements

      • Store the signal on the Connection class and update relevant properties to readonly
      • Consolidate all signal access to a throwIfAborted helper
      • Create and store aborted promise for socketWrite on the Connection class (avoids making a new signal handling promise every write)
      • Remove unused abortable helper

      Testing Requirements

      • assert addEventListener is only called once per command (in onData)

      Documentation Requirements

      • None

      Follow Up Requirements

      • None

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Durran Jordan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: