Skip redundant Item.dup in CI Variables Collection

What does this MR do and why?

Skip redundant Item.dup in CI Variables Collection

Eliminates unnecessary object duplication in the CI variable collection hot paths during pipeline creation. Items are effectively immutable; no code path mutates the internal variable hash after construction.

When the feature flag is enabled:

  • Item.fabricate returns the same Item object instead of a dup
  • Collection#initialize bypasses fabricate for existing Items
  • Collection#concat reuses Items directly from source Collections
  • Collection#+ delegates to concat for the same optimization

References

Related to #512876

POC: POC: Optimize CI Variables Collection and Item ... (!225902 - closed)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading