Skip to content

Improve dropdowns performance with lazy

What does this MR do?

Related to #321845 (closed)

Sets the artifacts and manual dropdowns in the pipelines page to lazy.

Why?

Depending on the pipeline, we will render up to 2 dropdowns for artifacts and manual actions respectively, in the gitlab project pipelines render ~15 of artifacts and many more elements when the pipeline has been stopped:

pipelines at GitLab
2021-02-22_11.49.08

This renders potentially hundreds of elements in the page that are never seen by users, until they open the dropdowns.

From https://bootstrap-vue.org/docs/components/dropdown:

By default, renders the menu contents in the DOM even when the menu is not shown. When there are a large number of dropdowns rendered on the same page, performance could be impacted due to larger overall memory utilization. You can instruct to render the menu contents only when it is shown by setting the lazy prop to true.

Screenshots (strongly suggested)

Pipeline page works the same way:

Screen_Shot_2021-02-22_at_12.11.24_PM

In a small test project with artifacts, the page contains fewer elements with lazy enabled:

before (959 elements) after (946 / 952 elements )
before-dropdown after-dropdown

Bonus

The position of the artifacts dropdown has been improved:

before after
Screen_Shot_2021-02-22_at_11.58.26_AM Screen_Shot_2021-02-22_at_11.58.36_AM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Miguel Rincon

Merge request reports