Skip to content

perf(install): download dependencies in parallel - #46

Merged
Chemaclass merged 1 commit into
mainfrom
perf/parallel-install
Jul 22, 2026
Merged

perf(install): download dependencies in parallel#46
Chemaclass merged 1 commit into
mainfrom
perf/parallel-install

Conversation

@Chemaclass

Copy link
Copy Markdown
Owner

Closes #24. Builds on the batched single-write lockfile flush (#26).

  • install downloads up to BASHDEP_JOBS (default 4) dependencies concurrently. Bash 3.2 has no wait -n, so it uses a batched pool (wait barrier every N jobs).
  • Each dependency runs in a background subshell (_install_one_async) that downloads and writes its lock_file\tname\turl entry 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) into BASHDEP_LOCK_PENDING, then _lock_flush writes each lockfile once. Concurrency never races the lockfile.
  • Dry-run and BASHDEP_JOBS=1 keep the sequential path (stable preview order / opt-out).
  • Fixed an 8-bit return truncation: an uncapped failure count > 255 wrapped (300 → 44), so _install_parallel caps before returning.

Test plan

  • Suite green + stable across 3 runs (parallel bashunit × parallel install): 184 tests / 264 assertions (+3)
  • New tests: parallel installs all deps, parallel failure counting, BASHDEP_JOBS=1 sequential; existing 255-cap test passes on the parallel path
  • make sa + make lint clean
  • Docs (api.md, behavior.md) + CHANGELOG (Added) updated

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
@Chemaclass Chemaclass added enhancement New feature or request performance Runtime or CI performance labels Jul 22, 2026
@Chemaclass Chemaclass self-assigned this Jul 22, 2026
@Chemaclass
Chemaclass merged commit 4fabbbc into main Jul 22, 2026
5 checks passed
@Chemaclass
Chemaclass deleted the perf/parallel-install branch July 22, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request performance Runtime or CI performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(install): download dependencies in parallel

1 participant