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

Python Driver uses list.pop() unnecessarily

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.3
    • Affects Version/s: None
    • Component/s: None
    • None

      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.

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

              Created:
              Updated:
              Resolved: