Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-4347

Optimize MongoClient._get_topology

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.8
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • 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?

      In PERF-5334 the server perf team discovered that their pymongo benchmark spends a lot of cpu time in MongoClient._get_topology. It's possible we can optimize this code path.

      For context, _get_topology() needs to ensure the topology state is opened. In the past, pymongo allowed a closed client to be automatically re-opened the next time the it was used. It's possible a lot of the work done in _get_topology can be skipped now that a closed client can never be re-opened.

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: