Repository navigation
perf(sync): reduce repeated parent cleanup during updates - #600
Merged
Merged
Conversation
This was referenced Oct 28, 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.
Summary
Repeated workspace updates finish faster for large skill trees by cleaning each distinct parent after its tracked sibling deletions finish. The measured 1,000-skill medians fell 12.5–16.5%, with existing ownership and symlink checks retained and immediate cleanup preserved for overlapping state entries.
The baseline is
e331f44(1.21.4). Existing unchanged-remote skips are included in that baseline; this change reduces remaining local filesystem work. Startup and copying remain substantial costs.Measurements
Three interleaved warmups per build, then 15 timed baseline/candidate pairs per scenario, alternating order. These are warm-filesystem measurements with isolated HOME/project fixtures, one Codex file-install client, and local bare Git remotes. There is no injected latency or live-network speedup claim. With 15 samples, nearest-rank p95 is the maximum sample, not a stable production-tail estimate.
The separate local-project trace reduced
rmdircalls from 3,000 to 2,001,readlinkfrom 31,018 to 21,028,statxfrom 28,032 to 26,071, andaccessfrom 4,020 to 3,021. Git work stayed identical: unchanged online updates made onels-remoteand zero clone/pull/fetch/merge/checkout/reset operations; offline updates made no remote calls. Small startup/empty-update timing differences are treated as noise.Environment: Node v26.7.0, Bun 1.4.3, Linux 7.0.0-38-generic, Intel i7-6700T. The report includes all 0/100/1,000-skill scenarios and the exact baseline/candidate bundle hashes.
Related: #594, already included in the baseline; its remote skip receives no performance credit in this PR.
Validation
bun run typecheck, explicit benchmark-script typecheck,bun run lint, andbun run buildpassed. Lint retains the existing 17 warnings..agents), normalized state, and Git counts. All 450 invocations, including initial materialization, warmups and traces, preserved expected source/cached-resource, config, and sentinel bytes/modes.update --scope project --offline --dry-runandstatuspreserved every fixture path, byte, mode, mtime, and symlink target after materialization.Focused command:
bun test tests/unit/core/sync-dedup.test.ts tests/unit/core/sync.test.ts \ tests/unit/core/sync-user.test.ts tests/unit/core/client-context.test.ts \ tests/unit/core/sync-symlink.test.ts tests/unit/core/omp-artifacts.test.tsExact measured command, using the immutable baseline copied before edits:
The report also provides commands to build baseline
e331f44in an isolated checkout from an already-modified branch. Broad integration validation is being run separately; no duplicate full suite was launched for publication.Evidence
The raw evidence contains task paths and benchmark metadata, with no real-user configuration or credentials. No live-network, cold-disk-cache, failed-remote, cancellation-latency, or multi-profile improvement is established.
Combined batch verification
The parent integrated #598, #599 and #600 on clean baseline
e331f44(integration tree54a8c5338bfa1caf0a187bae4c8cc94895338352) without conflicts. The integration tree is equivalent to applying these three PRs in that order.bun test: 2,402 passed, 7 skipped, 0 failed, 9,742 assertions across 200 files (171.53s).bun run build,bun run typecheck,bun run lint,bun run schema:check,bun run docs:build,bun run package:checkandbun run package:smoke: passed. Combined lint has zero warnings. Package smoke checked 54 help nodes.python3 /tmp/allagents-remaining-integration-manual.py(script reproduced in perf(sync): reduce repeated parent cleanup during updates #600) with five alternating baseline/candidate pairs after one materialization run per build. Its guards checked output/source/config/sentinel/state and client destination compatibility. Local-project median was 1,352.27ms → 1,183.30ms (12.49% lower). This is a corroborating warm-cache measurement; perf(sync): reduce repeated parent cleanup during updates #600's larger paired matrix is the primary performance evidence.Combined manual CLI and bounded performance reproduction
Build the combined candidate and baseline
e331f44as described in the performance report, then setcandidateandbaselineto those bundle paths. Save the script as/tmp/allagents-remaining-integration-manual.pyand runpython3 /tmp/allagents-remaining-integration-manual.py. The script removes its temporary fixtures.