Use the CommitLoader for bundleAnalysisCompareWithParent#1271
Conversation
✅ Sentry found no issues in your recent changes ✅ |
adrian-codecov
left a comment
There was a problem hiding this comment.
Can you explain a bit more how making the call async to load_... helps w/ the N+1?
|
https://github.com/syrusakbary/aiodataloader?tab=readme-ov-file#batching explains it quite well. Assuming we have an async framework based on an event-loop. We can call the async fns, and they will run immediately up until the first On the next tick of the event loop, all the The graphql framework in the background is executing all the resolvers concurrently, meaning all of them are running up until the first |
This is loading the `parent_commit` using the async batch-loading `CommitLoader`. This way, we can avoid one of the N+1 queries being executed when executing the `GetCommits` GraphQL query. However, we are still loading all the BA `CommitReport`s separately within `load_bundle_analysis_comparison`, which is another 2N+1 problem on its own. Will solve that one another time :-)
323ee99 to
cdbd476
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #1271 +/- ##
==========================================
- Coverage 96.32% 96.32% -0.01%
==========================================
Files 487 487
Lines 16892 16891 -1
==========================================
- Hits 16272 16271 -1
Misses 620 620
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
This is loading the
parent_commitusing the async batch-loadingCommitLoader.This way, we can avoid one of the N+1 queries being executed when executing the
GetCommitsGraphQL query.However, we are still loading all the BA
CommitReports separately withinload_bundle_analysis_comparison, which is another 2N+1 problem on its own. Will solve that one another time :-)