Repository navigation
Fetch registry files with more concurrency than tarballs - #1257
Merged
Merged
Conversation
Registry, policy and tarball fetches shared one Hex.Parallel limited to http_concurrency, 8 by default. Registry and policy files average a few kilobytes, so their fetch time is mostly round trips, while tarballs can be up to 16 MB and are held in memory while they're fetched. Registry and policy files now go through their own Hex.Parallel with four times http_concurrency, 32 by default. Tarballs keep http_concurrency, so setting HEX_HTTP_CONCURRENCY=1 on a slow network still fetches one tarball at a time. mix deps.get for a project with the 100 Hex packages in hexpm's mix.lock went from 2.68 s to 2.40 s, the median of 15 interleaved runs with an empty Hex cache and no deps directory, on macOS against repo.hex.pm.
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.
Registry, policy and tarball fetches shared one
Hex.Parallellimited tohttp_concurrency, 8 by default. Registry and policy files average a few kilobytes, so their fetch time is mostly round trips, while tarballs can be up to 16 MB and are held in memory while they're fetched.Registry and policy files now go through their own
Hex.Parallelwith four timeshttp_concurrency, 32 by default. Tarballs keephttp_concurrency, so settingHEX_HTTP_CONCURRENCY=1on a slow network still fetches one tarball at a time.mix deps.getfor the 100 Hex packages in hexpm'smix.lockwent from 2.68 s to 2.40 s, the median of 15 interleaved runs with an empty Hex cache and nodepsdirectory, on macOS against repo.hex.pm on 2026-10-06. It was faster in 14 of 15 pairs. On top of #1256 it went from 2.16 s to 2.04 s, faster in 14 of 15 pairs.This conflicts with #1260 in
lib/hex/scm.ex, whichever merges second needs a rebase.