Repository navigation
perf(git): batch context-store index writes on isomorphic-git 1.44.2 - #1423
Merged
TheGreatAxios merged 2 commits intoOct 15, 2026
Merged
Conversation
The store's per-file add/remove loop forced one index write per path; array-form add/remove stage everything inside one acquire and keep the on-error net state (nothing staged) identical via the same reset path. Multiple add failures now surface as MultipleGitError instead of the first error; the surrounding catch is type-agnostic.
Contributor
|
Superseded by the comment below. |
Contributor
|
Superseded by the comment below. |
Contributor
|
Triage: Unsure A maintainer will review this pull request. |
TheGreatAxios
changed the base branch from
cl-10658-pin-bump-bundle-types-bun-oxlintoxfmt-hono-drizzle-safe
to
main
October 15, 2026 19:17
Array git.remove throws before the index write, so swallowing that error committed every removed path still staged. Omit the failing path and write the rest once. If nothing can be unstaged, fail the commit instead.
Collaborator
Author
|
Independent perf verification for this PR (measure-only lane, no source touched). Method: benchmark pitting the exact pre-CL loop (
No follow-up needed — recording the numbers here. |
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.
Summary
isomorphic-gitto 1.44.2 via the existing^1.27.2catalog range (single lock resolution change; 1.42.7 index-write-once-per-walk and 1.43.3 packfile-checksum-once land on the context store's hot paths for free).add/removeloop (src/session/optimized-context-store.ts:~1335) into array-form calls on 1.43.0+ — oneGitIndexManager.acquireper call instead of one index write per path. On-error net state preserved: the sameresetIndexPaths(dir, extraPaths)reset covers the add∪remove union, so a mid-batch failure still leaves nothing staged. Sole behavioral delta: multiple simultaneous add failures surface asMultipleGitErrorinstead of the first error; the surrounding catch is type-agnostic.findRoot()conversion forproject-keywas evaluated and declined with evidence: the API is async-only while all four consumers (session/index.ts,crash/report.ts,permission/path-restriction.ts,config.ts) are synchronous by design, andfindRootignoresGIT_DIR/GIT_WORK_TREE/core.worktreesemantics thatrev-parse --show-toplevelhonors — different semantics under worktrees and env-var overrides (probes showed matching behavior under plain worktrees/submodules; the env-var cases are the decliners).Verification
bun run checkexit 0: full one-process suite 8939 pass / 0 fail across 581 files.bun test src/session/optimized-context-store.test.ts58 pass / 0 fail;bun test src/session563 pass / 0 fail across 41 files.isomorphic-git 1.41.9 → 1.44.2); no pin change, so the known bun re-dedupe shake (tracked in CL-10681) does not apply.Fixes CL-10654