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

Python Driver uses list.pop() unnecessarily

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 2.3
    • None
    • None

    Description

      The Python driver calls list.pop() to consume data returned within a Cursor. This modifies the Python list, which is unnecessary. Attached is a version of Cursor.py that uses a pointer to keep track of the next element returned obviating list modification. This speeds up iteration over larger results by up to 20% in our applications. I have run the tests that ship with the Python driver with this modified Cursor successfully.

      Attachments

        Issue Links

          Activity

            People

              ross@mongodb.com Ross Lawley
              acordova Aaron Cordova
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: