Optimize MongoClient._get_topology

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: 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?
    • None
    • None
    • None
    • None
    • None
    • None

      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
            Reporter:
            Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: