Loading
Reduce headPipeline queries in the merge request dashboard
What does this MR do and why?
Fixes two performance problems with headPipeline in the merge request dashboard GraphQL query (requestingReviewAuthorOrAssignee), found in a production performance bar profile.
- The
headPipelinelookahead preloaded themerge_request_diffassociation. That association has an order scope, so the preload loaded every diff version of each merge request (131 ms for 8 merge requests). The field only needs the head SHA of the latest diff, so the preload now useslatest_merge_request_diff, like thedetailed_merge_statuspreload already does. headPipeline { detailedStatus }ran onep_ci_buildscount query for each successful pipeline, because the status factory forced thenumber_of_warningsBatchLoader one pipeline at a time.PipelineType#detailed_statusnow queues the count for successful pipelines before the status is built, so 8 queries become 1.
References
Screenshots or screen recordings
| Before | After |
|---|---|
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.