Repository navigation
Keep parsed requirements in the registry server - #1276
Merged
Merged
Conversation
The parsed requirements were kept in the process dictionary of the process calling the registry, which is the Mix process or, with Mix.install/2, the user's own process, and stayed there after the registry closed. Parse the requirements of a release's dependencies in the registry server instead and keep them in its state until the registry closes. Unsatisfiable and invalid requirements come back as errors, so the caller still warns and raises as before. Copying the parsed constraints in the replies makes resolving hexpm's dependencies take 27 ms instead of 22 ms, against 37 ms without keeping them parsed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hex.Registry.Server.dependency_constraint/4kept parsed requirements in the process dictionary of the process calling the registry, which is the Mix process or, withMix.install/2, the user's own process, and they stayed there after the registry closed. This parses the requirements of a release's dependencies in the registry server and keeps them in its state until the registry closes. Unsatisfiable and invalid requirements come back to the caller as errors, so it still warns and raises as before. The change was asked for in review of #1272 but wasn't pushed before it merged.Copying the parsed constraints in the replies costs 5 ms. Resolution in offline
mix deps.get --check-lockedon a copy of hexpm takes 27 ms, against 22 ms with the process dictionary and 37 ms without keeping requirements parsed (medians of 15 runs, macOS, Elixir 1.20.4 / OTP 29.1.1).