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

Verdaccio is slow listing packages #2

Open
edclement opened this issue Oct 13, 2021 · 0 comments
Open

Verdaccio is slow listing packages #2

edclement opened this issue Oct 13, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@edclement
Copy link
Contributor

After updating Verdaccio to use this verdaccio-google-cloud-storage plugin, the time it takes to load the package list (and thus the web UI) has increased into the 3-6 second range. After investigation, this is due to:

  1. Everytime the package list is read the full list of package names is read from the GCP Datastore.
  2. Once the package list is read, the latest package.json file is pulled from GCP bucket. This happens sequentially instead of in parallel.

This issue cannot be fixed in the storage plugin. It needs to re fixed in the core Verdaccio code. Overall, the way Verdaccio handles loading of data could use a lot of optimization. A key function that could use refactoring is the getLocalDatabase member in the src/lib/storage.ts. This is the function that indirectly makes the calls mentioned in bullet points #1 and #2 above and carries out the reading of the package.json files in a sequential manner with a recursive callback function. You can see the code for that here. Specifically line 433 where the function calls itself only after the previous package.json file has been retrieved.

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

No branches or pull requests

2 participants