Skip to content

Performance: Preload pipeline in PipelinesController to fix N+1

Kamil Trzciński requested to merge preload-pipelines-controller into master

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.

Edited by Kamil Trzciński

Merge request reports