-
-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve eachBatch method #1179
Improve eachBatch method #1179
Conversation
I don't know why the tests are failing, I hope it has nothing to do with the modifications... |
Ok so I had to change the way I tested for the end of |
Codecov Report
@@ Coverage Diff @@
## master #1179 +/- ##
=======================================
Coverage 92.21% 92.22%
=======================================
Files 54 54
Lines 5268 5273 +5
Branches 1178 1180 +2
=======================================
+ Hits 4858 4863 +5
Misses 410 410
Continue to review full report at Codecov.
|
44f08f7
to
402ace4
Compare
(sorry for the force-pushed, I had wrongly pushed another commit with the "built" version I also have) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvements. LGTM!
@SebC99 Sorry for the late reply? Can you rebase your branch? |
…hile executing the callback on the previous result as the same time.
402ace4
to
61f8ef9
Compare
Done :) |
Currently, what's happening with the
eachBatch
Query method is this:The issue is that while executing the callback, nothing is done, and we have to wait for the next Find to succeed to start again the callback.
An easy improvement is to launch the next query in parallel of the execution of the callback, so that when the callback is done, the next batch is already ready to be consumed (or more advanced if the query is longer than the callback execution)
It's done by changing the order of the promises, and waiting for both the query and the callback on the previous batch to be resolved.