Skip to content

Speed up project creation by inlining repository creation

Nick Thomas requested to merge (removed):34533-speed-up-project-creation into master

What does this MR do?

Stops shelling out to gitlab-shell/bin/gitlab-projects when creating repositories. Instead, we do it directly in gitlab.

This is a 3 or 4-order-of-magnitude speedup when benchmarked locally (~120ms to < 0.1ms)

Each project creation involves two add_repository calls - project and wiki - so this removes about 240ms from a 600ms API call locally.

Benchmarking it, project create calls to a personal namespace now take 250-350ms locally.

Project imports are left untouched as the time saved would be dwarfed by the git fetch operation anyway.

Are there points in the code the reviewer needs to double check?

This replicates code currently in the gitlab-shell repository. That code should really move to gitaly instead. However, I don't think that should stop us from improving things now.

This is stomping all over our layers of abstraction, so I'll understand if this MR is deemed unacceptable 🚎 .

Why was this MR needed?

Speed up project creation

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #34533 (closed)

Edited by Nick Thomas

Merge request reports