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.
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:
Using an external database for package indexes could be also considered, but this would require further changes.