elastic / package-registry

Elastic Package Registry (EPR)
Other
9 stars 68 forks source link

Optimize semver constraint checks #1165

Open jsoriano opened 8 months ago

jsoriano commented 8 months ago

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.