Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-6531

Perf: Cache namespace parsing logic

    • 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 remove the recalculation of namespaces
      So that the driver doesn't perform unnecessary work

      User Experience

      • What is the desired/expected outcome for the user once this ticket is implemented?
        • No API change. Performance improves
      • If bug: What is the number of impacted customers? How severe is the impact? Is anyone blocked or broken?
        • N/A

      Dependencies

      • MongoDBNamespace

      Risks/Unknowns

      • What could go wrong while implementing this change? (e.g., performance, inadvertent behavioral changes in adjacent functionality, existing tech debt, etc)
        • Not much, test coverage should be complete on this subject
      • Is there an opportunity for better cross-driver alignment or testing in this area?
        • No
      • Is there an opportunity to improve existing documentation on this subject?
        • No

      Acceptance Criteria

      Implementation Requirements

      • Reduce reconstruction of MongoDBNamespace instances (remove "ns" util helper)
        • We should not split a string on dot more than once, and we should not allocate an object to multiple times to re-do that step.
        • The hello and auth commands can be hard coded to use dbName: admin, rather than parse "admin.$cmd" and construct a MongoDBNamespace.
        • Consider attaching dbName as a required parameter to the options after the operations.execute layer, commands do not need a collection name after that point (because it is in the command itself find: "collName")

      Testing Requirements

      • Check performance improvements.
      • All tests pass.

      Documentation Requirements

      • None

      Follow Up Requirements

      • N/A

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

              Created:
              Updated: