Details
-
Improvement
-
Status: Closed
-
Trivial - P5
-
Resolution: Duplicate
-
2.1.1
-
None
Description
The PyMongo Cursor returns results from a batch by doing self.__data.pop(0) for each element. This requires quadratic time over the size of the batch. In tests, Python can do pop(0) on a 16k-element list in 3 or 4 microseconds, so it's not a big problem. But reversing the list and doing pop() might save a couple microseconds for big queries.
Attachments
Issue Links
- duplicates
-
PYTHON-351 Python Driver uses list.pop() unnecessarily
-
- Closed
-