Optimise import performance
What does this MR do?
EE version: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14794
- Fix
O(n)
complexity ofappend_or_update_attribute
, we append objects to an array and re-save project - Remove the usage of
keys.include?
as it performsO(n)
search, instead use.has_key?
- Remove the usage of
.keys.first
as it performs a copy of all keys, instead use.first.first
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64924
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. -
Code review guidelines -
Merge request performance guidelines -
Style guides
Edited by 🤖 GitLab Bot 🤖