-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix: Improve child-doc resolver Performance #54
Conversation
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.
💯
https://gqlgen.com/reference/dataloaders/ |
https://github.com/syrusakbary/aiodataloader |
The dataloader implementations I have seen requires |
ahh hence the await i was wondering about that.. |
Related: #53 |
@e-lobo found a bug with |
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.
💯
Preface
get_cached_doc
was being called for each and every document being handled by gql-resolver be it child-doc or normal-doc.get_cached_doc
works as indented - loads from db on first call, serves from cache on second callObservations
Before & After
Query:
Before:
After:
Significant drop in number of queries can be observed.
There is a lot more room for improvements - let this be the first step 😄