Repository navigation
spice: Batch branch state and head loading - #1489
Merged
Merged
Conversation
Loading tracked branches runs individual state and head lookups in a worker pool, starting Git processes for every branch. Load their state through `Store.LookupBranches` and `GetMany`, and resolve requested local heads in one filtered `for-each-ref` call. The worker pool is no longer needed to overlap state and head lookups. Expose ordered `Service.LookupBranches` results with branch-specific errors and make singular service and store lookups specialize their batch APIs. Propagate `MissingKeysError` indexes with successful state responses so branch classification needs no individual rereads. Unexpected storage failures abort the batch. Share metadata interpretation, upstream verification, and deleted-branch handling with the existing lookup path. Local branch filters select literal names and slash-delimited prefixes, as used by branch lookup and sync deletion. If filter arguments exceed the Linux, macOS, or Windows process limit, retry without filters and match literal prefixes locally. Retry only before any branch has been emitted, preserving ordering and worktree metadata. On the macOS arm64 demo repository with 103 local branches, hyperfine uses 3 warmups and 15 runs of `log short` and `log long`, each with `--all --json`. Compared with the parent storage-support commit: | Listing | Parent mean +/- SD (s) | New mean +/- SD (s) | | --- | ---: | ---: | | Short | 1.601 +/- 0.299 | 1.550 +/- 0.353 | | Long | 1.816 +/- 0.343 | 1.253 +/- 0.221 | The short-listing difference is within the observed variation.
Owner
Author
|
This change is part of the following stack: Change managed by git-spice. |
This was referenced Oct 25, 2026
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.
Loading tracked branches runs individual state and head lookups in a
worker pool, starting Git processes for every branch.
Load their state through
Store.LookupBranchesandGetMany, andresolve requested local heads in one filtered
for-each-refcall.The worker pool is no longer needed to overlap state and head lookups.
Expose ordered
Service.LookupBranchesresults with branch-specificerrors and make singular service and store lookups specialize their
batch APIs.
Propagate
MissingKeysErrorindexes with successful state responsesso branch classification needs no individual rereads.
Unexpected storage failures abort the batch.
Share metadata interpretation, upstream verification, and deleted-branch
handling with the existing lookup path.
Local branch filters select literal names and slash-delimited prefixes,
as used by branch lookup and sync deletion.
If filter arguments exceed the Linux, macOS, or Windows process limit,
retry without filters and match literal prefixes locally.
Retry only before any branch has been emitted,
preserving ordering and worktree metadata.
On the macOS arm64 demo repository with 103 local branches, hyperfine
uses 3 warmups and 15 runs of
log shortandlog long, each with--all --json.Compared with the parent storage-support commit:
The short-listing difference is within the observed variation.