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

Optimize semver constraint checks #1165

Open
jsoriano opened this issue Mar 20, 2024 · 0 comments
Open

Optimize semver constraint checks #1165

jsoriano opened this issue Mar 20, 2024 · 0 comments

Comments

@jsoriano
Copy link
Member

jsoriano commented Mar 20, 2024

While investigating a possible memory leak, we found out that constraint checks take a significant part of the memory and CPU of each /search request.
Current implementation uses internally errors with formatted strings to notify that a constraint is not satisfied, this is converted to just a boolean in the interface we use. These are the strings taking most of the memory.

There is some potential for optimization there. Some ideas to explore:

  • Cache constraint checks (there is a limited number of combinations of constraints and versions to check).
  • Use a different implementation, or fork the current one, to avoid using so many formatted strings.

Using an external database for package indexes could be also considered, but this would require further changes.

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

No branches or pull requests

1 participant