-
Notifications
You must be signed in to change notification settings - Fork 64
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
Change proposal for over 20x speedup in findManyByIds #84
Labels
Comments
@gamebak In the end Dataloader only makes a single request with all the ids passed |
It doesn't, I've tested this, unless I'm missing something. |
It's certainly the intent of the DataLoader function to use apollo-datasource-mongodb/src/cache.js Line 112 in 2e048ce
If it's not working, would be happy to look at a PR that fixes it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Speed up proposal for method
findManyByIds
.apollo-datasource-mongodb/src/cache.js
Line 173 in 08e1c07
As-Is right now, it's opening a lot of
findOneById
with a promise.all, but it's really inefficient once you have over 100 keys and it's slowing the UI.While I don't exactly know how to implement this in the library exactly, the solution will look similar to this at the mongo level:
This will result in a single call to the server-side, speeding up for bigger queries.
The text was updated successfully, but these errors were encountered: