Skip to content

Improve pipeline creation service performance

What does this MR do?

This merge request improves pipeline creation service performance by around 30%.

It appears that we used to call Ci::Pipeline#autosave_associated_records_for_stages and then Ci::Pipeline#autosave_associated_records_for_builds, despite the fact that builds already have been saved after calling the former method, because stages are higher in the hierarchy than builds are.

It means that we are be able to remove code that modifies pipeline builds array in-place when we populate pipeline with builds, to make saving operation around 30% faster.

Results

  • Time of creating pipeline with 86 builds (.gitlab-ci.yml in GitLab CE) reduced from around 24s to 17s on my machine -> 30% faster.

  • Number of queries reduced from around 935 to 765 - around 20% less queries

Does this MR meet the acceptance criteria?

  • Changelog entry added
  • Has been reviewed by Backend
  • End-to-end tests pass (package-and-qa manual pipeline job)

What are the relevant issue numbers?

Closes gitlab-org/gitlab-ce#37987

Edited by Kamil Trzciński (Back 2025-01-01)

Merge request reports

Loading