perf(install): download dependencies in parallel - #46
Merged
Conversation
install now downloads up to BASHDEP_JOBS (default 4) dependencies concurrently via a batched background-job pool (Bash 3.2 has no wait -n). Each job runs in a subshell and writes its lockfile entry to a per-job result file; the parent aggregates them in dependency order and flushes once, so the deferred single-write lockfile is never raced. Dry-run and BASHDEP_JOBS=1 keep the sequential path. Closes #24
17 tasks
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.
Closes #24. Builds on the batched single-write lockfile flush (#26).
installdownloads up toBASHDEP_JOBS(default 4) dependencies concurrently. Bash 3.2 has nowait -n, so it uses a batched pool (waitbarrier every N jobs)._install_one_async) that downloads and writes itslock_file\tname\turlentry to a per-job result file — subshell array mutations don't reach the parent. The parent aggregates result files in dependency order (zero-padded filenames) intoBASHDEP_LOCK_PENDING, then_lock_flushwrites each lockfile once. Concurrency never races the lockfile.BASHDEP_JOBS=1keep the sequential path (stable preview order / opt-out).returntruncation: an uncapped failure count > 255 wrapped (300 → 44), so_install_parallelcaps before returning.Test plan
BASHDEP_JOBS=1sequential; existing 255-cap test passes on the parallel pathmake sa+make lintclean