Repository navigation
Conversation
nwparker
force-pushed
the
nwparker/perf-git-common-idle-gate
branch
from
July 22, 2026 07:08
589bee4 to
1588043
Compare
Contributor
Author
|
Adversarial review caught a real MEDIUM regression in the first cut and I fixed it: gating the structural leaves ( |
nwparker
force-pushed
the
nwparker/perf-s3-poller-gate
branch
from
July 22, 2026 23:00
f784f65 to
a90d5a5
Compare
nwparker
force-pushed
the
nwparker/perf-git-common-idle-gate
branch
3 times, most recently
from
July 22, 2026 23:26
c95316c to
934fdd3
Compare
nwparker
force-pushed
the
nwparker/perf-s3-poller-gate
branch
from
July 22, 2026 23:27
4dedb21 to
16455fd
Compare
nwparker
force-pushed
the
nwparker/perf-git-common-idle-gate
branch
from
July 22, 2026 23:27
934fdd3 to
f69788c
Compare
nwparker
force-pushed
the
nwparker/perf-s3-poller-gate
branch
from
July 23, 2026 00:49
16455fd to
a8f397a
Compare
Co-authored-by: Orca <[email protected]>
…FS add/remove The worktrees-dir readdir was gated on the dir's mtime:ctime:ino:size signature, so on a coarse-mtime/FAT filesystem a same-granule add+remove (all four fields collide) went undetected until the ~30s index backstop. A single readdir of a small dir is negligible next to the per-entry structural stats that already run every tick, so always enumerate — the listing is the authoritative add/remove signal. The expensive per-entry index read stays gated on each entry's own dir signature; onFullScan now reflects the ungated index-metadata backstop fan-out (the real periodic cost) rather than the readdir. Co-authored-by: Orca <[email protected]>
…on readdir failure Follow-up to always-enumerating the worktrees dir: the readdir catch-all treated ANY error as an authoritative empty listing, so a transient failure (EIO/ESTALE/EMFILE, network/SSH hiccup) emitted a false delete for every linked worktree (and a false create next tick) — and enumerating every tick widened that exposure. Only ENOENT (dir truly absent) now yields an empty listing; other errors retain the known entries so per-entry stats still run and a real removal surfaces as that entry's own stat miss. Adds a regression test (readdir → ENOTDIR) asserting no false delete. Co-authored-by: Orca <[email protected]>
nwparker
force-pushed
the
nwparker/perf-git-common-idle-gate
branch
from
July 23, 2026 00:49
f69788c to
ce0a64e
Compare
nwparker
added a commit
that referenced
this pull request
Jul 23, 2026
…re-open of #9882) (#10074) * perf(main): gate idle git-common polling Co-authored-by: Orca <[email protected]> * fix(main): enumerate git-common worktrees every tick to catch coarse-FS add/remove The worktrees-dir readdir was gated on the dir's mtime:ctime:ino:size signature, so on a coarse-mtime/FAT filesystem a same-granule add+remove (all four fields collide) went undetected until the ~30s index backstop. A single readdir of a small dir is negligible next to the per-entry structural stats that already run every tick, so always enumerate — the listing is the authoritative add/remove signal. The expensive per-entry index read stays gated on each entry's own dir signature; onFullScan now reflects the ungated index-metadata backstop fan-out (the real periodic cost) rather than the readdir. Co-authored-by: Orca <[email protected]> * fix(main): don't fabricate worktree deletions on a transient git-common readdir failure Follow-up to always-enumerating the worktrees dir: the readdir catch-all treated ANY error as an authoritative empty listing, so a transient failure (EIO/ESTALE/EMFILE, network/SSH hiccup) emitted a false delete for every linked worktree (and a false create next tick) — and enumerating every tick widened that exposure. Only ENOENT (dir truly absent) now yields an empty listing; other errors retain the known entries so per-entry stats still run and a real removal surfaces as that entry's own stat miss. Adds a regression test (readdir → ENOTDIR) asserting no false delete. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…re-open of stablyai#9882) (stablyai#10074) * perf(main): gate idle git-common polling Co-authored-by: Orca <[email protected]> * fix(main): enumerate git-common worktrees every tick to catch coarse-FS add/remove The worktrees-dir readdir was gated on the dir's mtime:ctime:ino:size signature, so on a coarse-mtime/FAT filesystem a same-granule add+remove (all four fields collide) went undetected until the ~30s index backstop. A single readdir of a small dir is negligible next to the per-entry structural stats that already run every tick, so always enumerate — the listing is the authoritative add/remove signal. The expensive per-entry index read stays gated on each entry's own dir signature; onFullScan now reflects the ungated index-metadata backstop fan-out (the real periodic cost) rather than the readdir. Co-authored-by: Orca <[email protected]> * fix(main): don't fabricate worktree deletions on a transient git-common readdir failure Follow-up to always-enumerating the worktrees dir: the readdir catch-all treated ANY error as an authoritative empty listing, so a transient failure (EIO/ESTALE/EMFILE, network/SSH hiccup) emitted a false delete for every linked worktree (and a false create next tick) — and enumerating every tick widened that exposure. Only ENOENT (dir truly absent) now yields an empty listing; other errors retain the known entries so per-entry stats still run and a real removal surfaces as that entry's own stat miss. Adds a regression test (readdir → ENOTDIR) asserting no false delete. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
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.
What
Stacked on #9849 (base =
nwparker/perf-s3-poller-gate). #9849 parks the worktree pollers while the window is hidden; this trims their cost while the window is visible and idle.The non-darwin (Windows/Linux) git-common poll re-enumerated the linked-worktrees directory (
readdir) on every 2s tick even when no linked worktree was added or removed. This gates thatreaddiron theworktrees/directory signature: it only re-enumerates when a linked worktree is actually added/removed (or on the 15-tick backstop). Everything else — theworktrees/stat, each known entry's dir stat, all structural leaves (HEAD,gitdir,locked,config.worktree) andlogs/HEAD, and the primary-checkout leaves — is still stat'd every tick, exactly as before, so detection latency is unchanged.indexkeeps its pre-existing 15-tick gate.ELI5
While Orca sat open and idle, it kept re-listing each repo's worktree folder twice a second even when no worktree was added or removed. Now it only re-lists when the folder actually changes; it still checks each worktree's HEAD/ref-log/metadata every tick, so nothing is noticed any slower.
Proof of zero regression
logs/HEAD+ primary leaves are re-stat'd every tick → an in-placeHEAD/branch/ref change surfaces within one tick, identical to before. New tests assert an in-placeHEADrewrite (no entry-dir change) is detected within a tick without triggering the gatedreaddir.worktrees/signature (now includingsize, so a same-granule coarse-timestamp change can't slip) →readdirre-runs → detected; the 15-tick backstop covers pathological cases; resume-after-hidden forces a full scan.typecheck:node/oxlintclean.Proof of perf improvement
While visible and idle, skips one
worktrees/readdirper repo per 2s tick (each enumerating every linked worktree withwithFileTypes), plus its per-entryDirentprocessing — ~10 readdirs/s eliminated at 20 repos, more as linked-worktree counts grow. A smaller, provably-safe subset of the original idea (the structural-stat skipping was reverted as unsafe).