Skip to content

log: Reuse loaded branch state in listings - #1490

Merged
abhinav merged 1 commit into
batch-branch-loadingfrom
list-reuse-loaded-branches
Oct 25, 2026
Merged

abhinav merged 1 commit into
batch-branch-loadingfrom
list-reuse-loaded-branches

Conversation

@abhinav

@abhinav abhinav commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Branch graph construction loads tracked state, but restack checks then
look up each branch again.
Pass the graph's existing branch records to
CheckLoadedBranchRestacked so listings avoid those repeated reads.
Keep graph loading behind Service.BranchGraph and share restack
reconciliation with CheckRestacked, including the recovered base hash
used to render a healed boundary.

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 branch-batching commit:

Listing Parent mean +/- SD (s) New mean +/- SD (s)
Short 1.043 +/- 0.127 0.590 +/- 0.157
Long 1.178 +/- 0.096 0.684 +/- 0.030

The collective effect of this stack is:

Benchmark 1: git-spice ls (10 runs)
                  mean ±     σ    min …   max
  Wall Time [s]  1.596 ± 0.388  1.269 … 2.396
  Memory [MiB]    24.0 ±   0.5   23.2 …  24.6

Benchmark 2: git-spice-new ls (10 runs)
                  mean ±     σ    min …   max
  Wall Time [s]  0.532 ± 0.064  0.488 … 0.699   -66.7%  (3.0x faster)
  Memory [MiB]    24.3 ±   0.2   23.9 …  24.6    +1.2%

Branch graph construction loads tracked state, but restack checks then
look up each branch again.
Pass the graph's existing branch records to
`CheckLoadedBranchRestacked` so listings avoid those repeated reads.
Keep graph loading behind `Service.BranchGraph` and share restack
reconciliation with `CheckRestacked`, including the recovered base hash
used to render a healed boundary.

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 branch-batching commit:

| Listing | Parent mean +/- SD (s) | New mean +/- SD (s) |
| --- | ---: | ---: |
| Short | 1.043 +/- 0.127 | 0.590 +/- 0.157 |
| Long | 1.178 +/- 0.096 | 0.684 +/- 0.030 |
@abhinav

abhinav commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

@abhinav
abhinav added this pull request to stack #1482 October 25, 2026 21:56
@abhinav
abhinav merged commit 4bfae2c into main Oct 25, 2026
22 checks passed
@abhinav
abhinav deleted the list-reuse-loaded-branches branch October 25, 2026 22:12
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