-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Trivial - P5
-
Affects Version/s: 2.1.1
-
Component/s: None
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.
- duplicates
-
PYTHON-351 Python Driver uses list.pop() unnecessarily
- Closed