Repository navigation
Reuse frozen full-selection trees during assisted commit capture [8/8] - #23124
Merged
Merged
Conversation
tidy-dev
previously approved these changes
Nov 4, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change to reuse frozen full-selection trees during assisted commit capture.
No open issues 🎉
What changed in this PR
This follow-up to #23081 reduces Git subprocess overhead during assisted commit capture by reusing frozen full-selection trees, while preserving partial-selection handling and existing safety checks.
Changes:
- Avoid three redundant Git operations per wholly selected file by reusing its immutable
fullTree. - Add real-Git regression tests for whole, partial and mixed selections, including literal paths and unrelated staged content.
- Document the capture-local reuse invariant and unchanged validation boundaries.
| File | Description |
|---|---|
docs/technical/assisted-commit-transactions.md |
Documents tree reuse and preserved safety checks. |
app/test/unit/git/assisted-commit-snapshot-test.ts |
Verifies operation counts, selected content and repository-state preservation. |
app/src/lib/git/assisted-commit/snapshot.ts |
Reuses fullTree for complete selections; retains separate materialization for partial selections. |
Review effort: Balanced
Base automatically changed from
sergiou87-assisted-commit-architecture-docs
to
development
November 4, 2026 17:59
sergiou87
dismissed
tidy-dev’s stale review
November 4, 2026 17:59
The merge-base changed after approval.
Complete selections already have an immutable per-file full tree with the same base, entry and blocking deletions as their selected tree. Reuse that object ID instead of repeating read-tree, update-index and write-tree for every fully selected path. Keep partial materialization, native diff certification and all final acceptance fences unchanged. Add real-Git command-count and selection-content regressions for whole, partial and mixed selections across shared and distinct directories, literal paths and unrelated staged content. Document the capture-local reuse invariant. A representative 48-file whole selection now launches 678 Git processes instead of 822. Five warmed macOS captures had median wall time 5.72s versus 6.94s; these shared-machine observations are not native Windows measurements.
sergiou87
force-pushed
the
sergiou87-assisted-commit-performance
branch
from
November 4, 2026 18:00
6eb692d to
70ab46c
Compare
sergiou87
enabled stacked auto-merge
November 4, 2026 18:21
tidy-dev
approved these changes
Nov 4, 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.
Follow-up to #23081; targets
sergiou87-assisted-commit-architecture-docs. No separate issue is closed.Description
Reduce the Git process startup cost of freezing whole-file selections before assisted commits. On the measured Windows ARM64 VM, capture was 13–16% faster for 12–48 wholly selected files, while the all-partial control was unchanged within noise.
fullTreebuilt from the same base, selected entry and blocking deletions. Reuse that object ID instead of building the identical selected tree again: one fewerread-tree,update-indexandwrite-treeper whole-selected file.Measurements
Windows measurements come from a supplied native Windows 11 ARM64 report: Parallels VM, 6 vCPUs, 10 GiB RAM, local NTFS, Defender enabled, native Node 24.22.1 and Desktop-bundled ARM64 Git 2.56.0.windows.4. One warmup plus five measured rounds per variant, alternating baseline/optimized order, all scenarios serial, no concurrent regression suite or build. These are capture-only wall times: harness process startup, fixture/request setup and disposal are outside the interval; Git subprocess startup is inside it. This is one ARM64 VM workload, not an x64 or population-wide performance claim.
macOS measurements used Node 24.22.1 and bundled Git 2.56.0 on macOS 26.7.2 arm64: one warmup plus five sequential samples per variant, non-interleaved before/after runs on a shared machine. These timings are observational; the unchanged all-partial control also varied. macOS Git totals are exactly two below every Windows cell because the Windows fixture commits
.gitattributes; freezing it adds onehash-objectand oneupdate-index, not Windows-specific production work.Only the expected three materialization operations changed in count per whole-selected file. The Windows report records all 72 captures preserving exact selected trees/blob manifests, HEAD and HEAD-file bytes, index bytes, working-file bytes and owned disposal; unrelated staged and working content never entered the selected tree. Local macOS raw traces and the supplied Windows report were inspected; the Windows raw JSON/log files remain on the VM and are not attached to this PR.
Benchmarks compare
4f843bc0d89a2060c1f93a1803fef257d5c529b7with the original optimization6d90f1ad2c606897cd41af6d901ebbd1b1108850. The optimization was then rebased onto stack parent65bcfc973dda124c475b3b8ed091fcc7aa1bdf9a;git range-diffreports an identical patch, and the measured assisted-commit production files, regression test and fixture helper are byte-identical after rebase. Benchmarks were not rerun on the rebased commit.Validation
Current rebased commit:
6eb692dc9ba8f700097c171da6cdc51ed548e165.node vendor/yarn-1.21.1.js test app/test/unit/git/assisted-commit-snapshot-test.ts— passed, 3/3 on the rebased commit. Before the optimization, whole/mixed count assertions failed; the all-partial case already passed.GIT_CONFIG_PARAMETERS="'safe.bareRepository=all'" node vendor/yarn-1.21.1.js test --test-concurrency=4— passed, 3566 passed / 2 skipped / 0 failed on the rebased commit.node vendor/yarn-1.21.1.js lint:fix— passed on the rebased commit; no working-tree edits.node vendor/yarn-1.21.1.js lint— passed on the rebased commit.node vendor/yarn-1.21.1.js tsc --noEmit— passed on the rebased commit.node vendor/yarn-1.21.1.js exec markdownlint -- docs/technical/assisted-commit-transactions.md --config .markdownlint.js --rules .markdownlint-rules.js— passed.git diff --check HEAD^ HEAD— passed.The full-suite bare-repository override is process-local. The initial macOS run on the original optimization had four unrelated push/bare-discovery failures caused by an injected
safe.bareRepository=explicit; all four also failed with the original production source restored. The previous full run passed with the test-local override, without changing production policy or any Git configuration file.The supplied Windows report ran relevant transaction/integration, planning, selected-fence, cleanup, completion and real-hook suites: baseline 153 passed / 3 failed / 15 skipped; optimized 156 passed / the same 3 failed / 15 skipped, including the three added tree-reuse tests. The three existing hook failures reproduced independently as exit 127,
sleep: command not found. Supplemental unchanged focused reruns passed 3/3 on each variant with a process-local Node-backedsleephelper; that helper was not used for any performance measurement. These supplemental results do not turn the original failing suite commands into passing runs. Exact Windows per-suite commands and raw logs are listed in the VM report artifacts but are not attached here.No full Windows unit suite, product build, live-model test or UI E2E run was performed.
Stack
Existing ordered stack members are preserved, including the five already-merged layers. This PR adds the next layer above #23081.
Team-authored review
Evidence: Measurements and validation above. No visual artifact is applicable to this backend-only change.
Review path: Lightweight review. The author has assessed the change and evidence.
Screenshots
N/A — backend-only optimization; no UI changes.
Release notes
Notes: no-notes