Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selectively render the vulnerable element on manage packages page #9328

Merged
merged 2 commits into from
Dec 15, 2022

Conversation

joelverhagen
Copy link
Member

@joelverhagen joelverhagen commented Dec 14, 2022

This significantly improves performance for the manage packages page. For a user with 1000 package IDs, it went from a 7 second page render time to 3 seconds.

There are two changes:

  • Significant: don't render the vulnerable element when the package is not vulnerable. Previously it was hidden but still in the DOM causing the expensive setPopovers method to run for each package.
  • Small improvement: use this instead of $(this).get(0) to get the DOM element. (improved cumulative setPopovers execution time from 4.381 seconds to 4.089 seconds.

Perf before:
image

Perf after:
image

(tons on setPopovers calls removed)

The page is still slow, but more usable than before.

Progress on #5877

This significantly improves performance for the manage packages page. For a user with 1000 package IDs, it went from a 7 second page render time to 3 seconds. The .get(0) to [0] changes are a perf change recommended by jQuery docs.
@joelverhagen joelverhagen requested a review from a team as a code owner December 14, 2022 23:11
Copy link
Contributor

@drewgillies drewgillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful! :)

@drewgillies
Copy link
Contributor

@joelverhagen I'm curious - was this invetsigation in response to a perf complaint, observation or hunch?

@joelverhagen joelverhagen merged commit e031d69 into dev Dec 15, 2022
@joelverhagen joelverhagen deleted the jver-manage-perf branch December 15, 2022 00:27
@joelverhagen
Copy link
Member Author

@joelverhagen I'm curious - was this invetsigation in response to a perf complaint, observation or hunch?

Sorry, missed your comment prior to merge. It was something I noticed while accepting an ownership request on behalf of @clairernovotny 😃. She mentioned it's slow for her too.

@drewgillies
Copy link
Contributor

@joelverhagen Discussion point only--I wasn't blocking on it, was just wondering how it surfaced. Great improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants