Performance: Preload pipeline in PipelinesController to fix N+1
What does this MR do and why?
It appears that when merge_trains
feature is used we are
fetching and creating the pipeline and merge request object over and over.
Even though the N+1 is solved by cached query, the AR object initialization makes this endpoint to spend 6s instead of 100ms on GitLab.com for GitLab Rails pipelines.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Kamil Trzciński