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

Python Driver uses list.pop() unnecessarily

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.3
    • None
    • 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

        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: