4 ms·
On a related note, skip(n) is also O(n) so the farther you paginate the slower it gets.
by scg 15y ago
On a related note, skip(n) is also O(n) so the farther you paginate the slower it gets.
- cheald 15y agoYup, but the slow part of count() is the value comparison over n documents, moreso than the actual iteration. So while the point holds true, it's less of a practical concern.