Skip to content

perf(lockfiles): regenerate a repository's branches side by side - #187

Merged
sweepies merged 1 commit into
mainfrom
perf/parallel-lockfiles
Nov 4, 2026
Merged

sweepies merged 1 commit into
mainfrom
perf/parallel-lockfiles

Conversation

@sweepies

@sweepies sweepies commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Finding #8 from the speed survey: the engine regenerated each branch's lockfiles in turn, though every plan already works in its own scratch tree.

  • Runner::prepare_all(plans, snapshot, config, concurrency, done) runs plans concurrently. The engine uses one per CPU core, up to four, since the tools are CPU-bound and perf(server): run batches of different installations at once #185 runs other installations' batches beside it.
  • generate returned nothing and wrote the base blobs of the lockfiles it changed into the snapshot. It now returns them, and they're merged afterwards. They're the same for every plan, since all plans share the base commit, and generate never read the snapshot otherwise.
  • prepare (single plan) keeps its behaviour for its callers.
  • Checkouts from the shared partial clone still take turns under the existing clone lock; only the tool runs overlap.

Test: three plans with a 50 ms tool each run with at least two tools at once, all finish with their lockfiles ready, and the snapshot gains the base blob.

View guided diff Turn on auto-fix

Each branch's lockfiles were regenerated one after another, though each
works in its own scratch tree. `Runner::prepare_all` runs them one per CPU
core, up to four, and merges the base blobs they add into the snapshot
afterwards; `generate` no longer touches the snapshot. Checkouts from the
shared clone still take turns under its lock.
@sweepies
sweepies merged commit 4b9a9dc into main Nov 4, 2026
12 checks passed
@sweepies
sweepies deleted the perf/parallel-lockfiles branch November 4, 2026 15:19
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