Refactor connection checkout to reduce layers

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      Currently, acquiring a connection requires passing through several functions and context managers. We should reduce the number of layers to reduce the overhead of checking a connection in and out. From investigation in PYTHON-5007 this approach can increase thread efficiency for small reads by about 10%. Additionally, RunCommand and RunCommand8Threads both showed improvement in this patch build, with this diff.

      Definition of done

      Flatten the checkin/checkout path where possible, while avoiding any regressions.

      Pitfalls

      We may have to duplicate logic to allow for flattening.
      We should wait until the backpressure branch is merged, since it is making changes to the way connections are checked in/out.

            Assignee:
            Steve Silvester
            Reporter:
            Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: