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

Improve performance #883

Open
styfle opened this issue Dec 20, 2021 · 1 comment
Open

Improve performance #883

styfle opened this issue Dec 20, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@styfle
Copy link
Owner

styfle commented Dec 20, 2021

We're currently doing a lot of work to render the top 10 npm version sizes.

  1. Retrieve npm manifest from registry
  2. Sort all versions with semver
  3. Filter down to 5 less than and 5 greater than current version
  4. Fetch all versions from redis (this can be very slow)

Perhaps we can utilize a Sorted Set in Redis so we can easily page through results.

https://redis.io/commands#sorted_set

@styfle styfle added the enhancement New feature or request label Dec 20, 2021
@styfle
Copy link
Owner Author

styfle commented Aug 12, 2024

It turns out that fetching the package.json is actually the slowest part so there was an in memory cache added here:

fetchJSON: 627.704ms
findOne (redis): 18.767ms
findAll (redis): 34.463ms

It might be worth investigating if we can improve redis a bit by using a Sorted Set, but a better first step is to improve package.json caching since that is significantly slower.

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

1 participant