Skip to content

Keep parsed requirements in the registry server - #1276

Merged
ericmj merged 1 commit into
mainfrom
registry-parsed-requirements
Oct 15, 2026
Merged

ericmj merged 1 commit into
mainfrom
registry-parsed-requirements

Conversation

@ericmj

@ericmj ericmj commented Oct 14, 2026

Copy link
Copy Markdown
Member

Hex.Registry.Server.dependency_constraint/4 kept parsed requirements 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 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-locked on 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).

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.
@ericmj
ericmj merged commit fde8242 into main Oct 15, 2026
22 checks passed
@ericmj
ericmj deleted the registry-parsed-requirements branch October 15, 2026 10:44
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

Successfully merging this pull request may close these issues.

1 participant