Skip to content

Cut fseventsd load: fix macOS exclusion cap, drop wide always-on FSEvents streams - #7068

Merged
nwparker merged 2 commits into
mainfrom
nwparker/fseventsd
Jul 2, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/fseventsd

Conversation

@nwparker

@nwparker nwparker commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem

macOS fseventsd ballooned to 95GB RSS on a machine running Orca with ~146 worktrees and multiple agents. fseventsd memory/CPU scales with event volume × registered client streams × delivery work (documented multi-GB blowups exist from a single over-broad client: colima#1569), and macOS 26.x additionally has a widely-reported system memory-leak regression that compounds under heavy delivery. There is also a system-wide 1024 FSEvents client cap past which watching silently fails.

Orca was making fseventsd do dramatically more delivery work than needed, three ways:

Root causes fixed

1. macOS exclusion-path cap silently disabled all daemon-side exclusions

@parcel/watcher passes plain-path ignore entries to FSEventStreamSetExclusionPaths (true daemon-side filtering), but macOS caps that at 8 paths per stream and fails closed — and parcel never checks the return value. Orca passed 9 entries, so every per-worktree explorer stream (one per worktree with an open editor tab, persisted across restarts) received full per-file node_modules/.git delivery and discarded it in userspace.

Fixed by capping plain paths at 8 (extras demoted to userspace globs) in a shared filesystem-watcher-ignore module, used by both the explorer watcher and the runtime file-watcher host — which also unifies the two ignore lists, so parcel's native per-(root, ignore) dedup now shares one stream when both watch the same root.

2. Always-on recursive streams over entire workspace roots and whole .git dirs

worktree-base-directory-watcher subscribed a recursive FSEvents stream per repo over the entire workspace root (all worktrees, e.g. ~/orca/workspaces/orca with 146 of them) plus another over the repo's whole common .git (objects included) — with glob-only ignores, i.e. zero daemon-side exclusion — just to observe <wt>/.git completion markers, <wt> deletions, and .git/worktrees/* metadata. Every agent write, build, fetch, and pnpm install in any worktree was delivered to Orca (and buffered per-stream inside fseventsd) to be thrown away by a JS filter.

Replaced with a two-part scheme sized to what the event filter actually consumes:

  • Worktree metadata (git-common), macOS: one narrow native stream rooted at <common>/.git/worktrees — a tiny, rare-churn tree. Zero idle cost, zero wide-scope delivery, and instant detection: git worktree add/remove always writes here, so external add/remove/HEAD changes surface sub-second. If the dir doesn't exist yet (no linked worktrees) a 1-stat existence poll arms the stream when it appears; if git worktree prune deletes it, the watcher re-arms the same way. On Windows/Linux this stays a listing poll (no fseventsd to protect; on Windows an open directory handle could interfere with prune removing the dir).
  • Workspace roots (base), all platforms: a 2s poll whose tick is mtime-gated — one stat of the root (plus nested repo containers); the readdir + per-worktree .git-marker fan-out only runs when a gate dir actually changed, with a 30s ungated full-scan backstop and a bounded recheck list for worktrees whose .git marker lands after the dir. Registers zero fseventsd clients.

3. App-lifetime fs.watch on $TMPDIR

The serve-sim state watcher held a permanent FSEvents client on the system's highest-churn directory, even though a 250ms existence poll already ran alongside it. Dropped the parent watch; the poll alone attaches the narrow $TMPDIR/serve-sim/ watcher when the dir appears.

Evidence (reproduced before fixing)

Identical 30k-op node_modules churn burst; metric is watching-process CPU including the native FSEvents drain thread, proportional to what fseventsd had to enqueue + deliver:

configuration CPU events delivered to JS
explorer stream, old 9-entry ignore (exclusions silently off) 82ms 0 (filtered in userspace)
explorer stream, new capped ignore (exclusions on) 5ms (16×) 0 (never delivered)
base stream at workspace root, old glob-only ignore 354ms n/a
new shallow watcher/poller 5ms (70×), 0 wide fseventsd clients n/a

Idle cost of the replacement, simulated at 146 worktrees:

idle tick cost
ungated scan (readdir + per-dir stat fan-out) 600µs
mtime-gated tick (shipped) 1.1µs (~545×)
macOS worktree-metadata watching 0 syscalls (narrow event stream)

Control experiments on the affected machine showed fseventsd RSS is insensitive to raw churn (~0.14MB per 80k events), suspended clients (bounded queue, then drops), and 100 idle clients (~6KB each) — the damage comes from sustained wide-scope delivery, which is exactly what these changes eliminate. At 15 repos + 50 open worktrees this removes ~30 always-on whole-tree streams (replaced by ~15 tiny .git/worktrees streams + gated polls) and restores daemon-side exclusion on the ~50 per-worktree streams.

E2E verification (dev build, CDP)

  • App boots cleanly with the new watchers; identity Orca: nwparker/fseventsd.
  • External git worktree add from a terminal → sidebar store updated in 728ms.
  • External git worktree remove → detected in 2.4s (pre-narrow-stream build; now event-driven on macOS).
  • Explorer watch on a worktree: visible file create delivered; 50-file node_modules churn delivered zero events.
  • Unit: 35 tests pass across the touched suites, including real-fs poller tests, macOS narrow-stream tests (add/update/remove, late arming, prune + recreate re-arming), an idle-gate test, and an 8-cap regression test; pnpm typecheck clean.

ELI5

macOS has one built-in "post office" for file changes (fseventsd). Any app can subscribe: "deliver me a note whenever anything changes under this folder." The post office does real work for every note — sorting, packaging, delivering a copy to each subscriber — and on macOS 26 it also has a hoarding problem: under heavy load it never quite gives back the memory it used. That's the 95GB.

Orca was the post office's worst customer, three ways:

  1. It subscribed to gigantic folders. To notice "a worktree appeared/disappeared", Orca subscribed to the folder containing all your worktrees — so every file an agent wrote, every pnpm install, every build in any of 146 worktrees got packaged and delivered to Orca... which read the address and threw it away. Now Orca subscribes only to git's tiny worktree-bookkeeping folder (a few entries, changes only when worktrees actually change) and otherwise just checks a timestamp — one glance every 2 seconds, escalating to a real look only when the timestamp moved.
  2. Its "no junk mail" sticker was invalid. For the per-worktree file-explorer subscriptions, Orca attached a list of 9 noisy folders to skip (node_modules, .git, ...). macOS only accepts stickers with 8 or fewer entries — one over, and it silently ignores the whole sticker. So the post office delivered all the junk mail anyway. Now the sticker has 8 entries and actually works: junk is discarded at the post office, never delivered.
  3. It watched the town dump. Orca kept a lifetime subscription on the system temp folder (the churniest place on disk) to notice one rare thing, even though it already had a cheap periodic check for the same thing. The subscription is gone.

Orca can't fix the post office's hoarding bug (that's Apple's), but it can stop sending it 100× more work than needed — which is what feeds the hoarding.

User-visible trade-offs

Honest list of what changes, and by how much:

area before after felt impact
Worktree created/removed outside Orca via git (git worktree add/remove in a terminal, scripts) ~0.3–0.5s macOS: sub-second (event-driven via the worktree-metadata stream). Win/Linux: ≤2s poll tick. None on macOS; a beat later elsewhere. Worktrees managed through Orca (UI, agents, orca-cli) are unaffected — those notify directly.
External branch/HEAD changes reflected in the worktree list near-instant macOS: near-instant. Win/Linux: ≤2s. None on macOS.
Worktree dir deleted without git (rm -rf) near-instant ≤2s (mtime-gated tick; the deletion itself bumps the root dir timestamp, so it's caught on the next tick) A beat later; git metadata cleanup (prune) is still instant on macOS.
External serve-sim --detach pickup instant ≤250ms Imperceptible.
Idle background cost zero when disk idle (event-driven) ~1µs per 2s tick per workspace root (one stat; measured at 146 worktrees), 0 syscalls for macOS worktree metadata, plus a 30s full-scan backstop Nothing measurable; strictly cheaper than the FSEvents delivery it replaced whenever anything on disk is active.
__pycache__ churn (the demoted 9th ignore entry) delivered + discarded in-process (exclusions were broken for all dirs) still delivered + discarded in-process, but the other 8 dirs are now excluded daemon-side Strictly better than before; just not daemon-side-free like the top 8.

Explicitly unchanged: file-explorer auto-refresh behavior and its ignore semantics (dirs like dist/node_modules never auto-refreshed by design), SSH/remote worktree watching (still provider.watch), WSL watching (still the snapshot subprocess with the same plain-name list), and all Orca-initiated worktree flows.

Not fixed here (follow-ups)

  • Terminal-history checkpoint cadence (5s per dirty PTY, multi-MB rewrites) is Orca's dominant write churn — separate perf PR with its own repro.
  • persistence.ts 300ms full-state rewrites, unthrottled conflict-summary git fetch/merge-tree — same.
  • The macOS 26.x (Tahoe) system memory-leak regression is an OS bug we can only starve, not fix; if fseventsd balloons again, ps -o rss= -p $(pgrep -x fseventsd) trend + log show --predicate 'process == "fseventsd"' will attribute it.

…ents streams

- @parcel/watcher maps plain-path ignores to FSEventStreamSetExclusionPaths,
  but macOS caps exclusions at 8 per stream and fails closed. Orca passed 9,
  silently disabling ALL daemon-side exclusions: fseventsd delivered every
  node_modules/.git event to each per-worktree explorer stream (measured 16x
  client CPU). Cap plain paths at 8 (extras demoted to userspace globs) via a
  shared filesystem-watcher-ignore module, also unifying the runtime
  file-watcher host list so identical roots share one native stream.
- worktree-base-directory-watcher subscribed recursive FSEvents streams over
  every repo's ENTIRE workspace root (all worktrees) and whole common .git
  (objects included) with glob-only ignores (zero daemon-side exclusion),
  just to observe a few shallow paths. Replace with a 2s readdir/stat poller
  (zero fseventsd clients, measured 70x less delivery CPU); SSH targets keep
  provider.watch unchanged.
- serve-sim state watcher held an app-lifetime fs.watch on $TMPDIR (the
  noisiest dir on the system); its existing 250ms existence poll makes the
  parent watch redundant, so drop it.

Co-authored-by: Orca <[email protected]>
@ghost

ghost commented Jul 2, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Unify and cap filesystem watcher ignore lists
2 Implement shallow poller for worktree base directories
3 Switch worktree watcher to use shallow poller
4 Remove high-churn $TMPDIR watch in serve-sim
Open in Stage

Chapters generated by Stage for commit 3beffc6 on Jul 2, 2026 4:37am UTC.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c897b66a-c9ec-43e5-b433-d76f6252000d

📥 Commits

Reviewing files that changed from the base of the PR and between 3beffc6 and 8992b90.

📒 Files selected for processing (3)
  • src/main/ipc/worktree-base-directory-poller.test.ts
  • src/main/ipc/worktree-base-directory-poller.ts
  • src/main/ipc/worktree-git-common-watch.ts

📝 Walkthrough

Walkthrough

This PR replaces several @parcel/watcher-based filesystem monitoring paths with polling-based implementations. It adds a shared watcher-ignore helper used by filesystem watcher setup and the runtime file watcher host. It introduces a worktree base directory poller and a git-common worktree metadata watcher, then updates the worktree base directory watcher to use the poller. ServeSimStateWatcher now polls for stateDir availability instead of watching its parent directory. Related tests were added or updated for the new polling and ignore behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is detailed, but it does not use the required template sections for Summary, Screenshots, Testing, AI Review Report, Security Audit, and Notes. Rewrite the description to follow the template and add the missing sections, including the testing checklist, AI review, security audit, and notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main performance-focused change set around macOS FSEvents reduction and exclusion-cap fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (4)
src/main/emulator/serve-sim-state-watcher.ts (1)

156-169: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Trim the Why comment to guideline length.

Logic is correct (guard/poll substitution for the removed parentWatcher), but the added comment spans 4 lines where the guideline asks for one or two.

✏️ Suggested tightening
-      // Why: $TMPDIR/serve-sim/ may not exist until the first terminal `serve-sim --detach`.
-      // Poll for it instead of fs.watch on the parent tmpdir: watching $TMPDIR
-      // registers a permanent FSEvents client on the system's highest-churn
-      // directory, while an existence poll costs the daemon nothing.
+      // Why: poll for stateDir existence instead of fs.watch on $TMPDIR, which
+      // would register a permanent FSEvents client on the highest-churn dir.

As per coding guidelines, "Keep comments short — one or two lines, capturing only the non-obvious reason."

Source: Coding guidelines

src/main/ipc/filesystem-watcher-ignore.ts (1)

5-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider a readonly type for the shared constant.

WATCHER_IGNORE_DIRS is exported and consumed by multiple modules (filesystem-watcher.ts, file-watcher-host.ts). Typing it as readonly string[] (or as const) would prevent accidental mutation by a consumer from affecting every watcher.

♻️ Proposed tweak
-export const WATCHER_IGNORE_DIRS: string[] = [
+export const WATCHER_IGNORE_DIRS: readonly string[] = [
src/main/ipc/worktree-base-directory-poller.ts (2)

82-84: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Sequential per-entry stat calls could be parallelized.

Each candidate/entry is stat'd one at a time in a for loop. For repos with many worktrees this adds up, though the 2s poll interval limits impact today.

♻️ Proposed parallelization
-  for (const dir of candidates) {
-    markers.set(dir, await hasGitMarker(dir))
-  }
+  await Promise.all(
+    candidates.map(async (dir) => {
+      markers.set(dir, await hasGitMarker(dir))
+    })
+  )

Also applies to: 116-123


176-198: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Persistent snapshot failures are silently swallowed forever.

The .catch(() => {...}) treats every snapshot failure as transient and never logs. If a target becomes permanently unreadable (permissions revoked, deleted mount, etc.), the poller will retry silently every 2s indefinitely with no diagnostic trail — unlike the previous @parcel/watcher error callback, which logged and triggered explicit cleanup. Consider logging (rate-limited) on repeated consecutive failures so real problems are debuggable.

🔍 Illustrative fix
+  let consecutiveFailures = 0
   const timer = setInterval(() => {
     if (disposed || ticking) {
       return
     }
     ticking = true
     void takeSnapshot(target, getRepos)
       .then((next) => {
         if (disposed) {
           return
         }
         const events = diffSnapshots(snapshot, next)
         snapshot = next
+        consecutiveFailures = 0
         if (events.length > 0) {
           onEvents(events)
         }
       })
-      .catch(() => {
-        // Transient fs error: keep the previous snapshot and retry next tick.
-      })
+      .catch(() => {
+        consecutiveFailures++
+        if (consecutiveFailures === 5) {
+          console.error(`[worktree-base-directory-poller] repeated snapshot failures for ${target.key}`)
+        }
+      })
       .finally(() => {
         ticking = false
       })
   }, pollIntervalMs)

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 36ae6b93-c70d-4930-ad6e-763736150487

📥 Commits

Reviewing files that changed from the base of the PR and between 4dbc9f3 and 3beffc6.

📒 Files selected for processing (10)
  • src/main/emulator/serve-sim-state-watcher.test.ts
  • src/main/emulator/serve-sim-state-watcher.ts
  • src/main/ipc/filesystem-watcher-ignore.test.ts
  • src/main/ipc/filesystem-watcher-ignore.ts
  • src/main/ipc/filesystem-watcher.ts
  • src/main/ipc/worktree-base-directory-poller.test.ts
  • src/main/ipc/worktree-base-directory-poller.ts
  • src/main/ipc/worktree-base-directory-watcher.test.ts
  • src/main/ipc/worktree-base-directory-watcher.ts
  • src/main/runtime/file-watcher-host.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (4)
src/main/emulator/serve-sim-state-watcher.ts (1)

156-169: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Trim the Why comment to guideline length.

Logic is correct (guard/poll substitution for the removed parentWatcher), but the added comment spans 4 lines where the guideline asks for one or two.

✏️ Suggested tightening
-      // Why: $TMPDIR/serve-sim/ may not exist until the first terminal `serve-sim --detach`.
-      // Poll for it instead of fs.watch on the parent tmpdir: watching $TMPDIR
-      // registers a permanent FSEvents client on the system's highest-churn
-      // directory, while an existence poll costs the daemon nothing.
+      // Why: poll for stateDir existence instead of fs.watch on $TMPDIR, which
+      // would register a permanent FSEvents client on the highest-churn dir.

As per coding guidelines, "Keep comments short — one or two lines, capturing only the non-obvious reason."

Source: Coding guidelines

src/main/ipc/filesystem-watcher-ignore.ts (1)

5-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider a readonly type for the shared constant.

WATCHER_IGNORE_DIRS is exported and consumed by multiple modules (filesystem-watcher.ts, file-watcher-host.ts). Typing it as readonly string[] (or as const) would prevent accidental mutation by a consumer from affecting every watcher.

♻️ Proposed tweak
-export const WATCHER_IGNORE_DIRS: string[] = [
+export const WATCHER_IGNORE_DIRS: readonly string[] = [
src/main/ipc/worktree-base-directory-poller.ts (2)

82-84: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Sequential per-entry stat calls could be parallelized.

Each candidate/entry is stat'd one at a time in a for loop. For repos with many worktrees this adds up, though the 2s poll interval limits impact today.

♻️ Proposed parallelization
-  for (const dir of candidates) {
-    markers.set(dir, await hasGitMarker(dir))
-  }
+  await Promise.all(
+    candidates.map(async (dir) => {
+      markers.set(dir, await hasGitMarker(dir))
+    })
+  )

Also applies to: 116-123


176-198: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Persistent snapshot failures are silently swallowed forever.

The .catch(() => {...}) treats every snapshot failure as transient and never logs. If a target becomes permanently unreadable (permissions revoked, deleted mount, etc.), the poller will retry silently every 2s indefinitely with no diagnostic trail — unlike the previous @parcel/watcher error callback, which logged and triggered explicit cleanup. Consider logging (rate-limited) on repeated consecutive failures so real problems are debuggable.

🔍 Illustrative fix
+  let consecutiveFailures = 0
   const timer = setInterval(() => {
     if (disposed || ticking) {
       return
     }
     ticking = true
     void takeSnapshot(target, getRepos)
       .then((next) => {
         if (disposed) {
           return
         }
         const events = diffSnapshots(snapshot, next)
         snapshot = next
+        consecutiveFailures = 0
         if (events.length > 0) {
           onEvents(events)
         }
       })
-      .catch(() => {
-        // Transient fs error: keep the previous snapshot and retry next tick.
-      })
+      .catch(() => {
+        consecutiveFailures++
+        if (consecutiveFailures === 5) {
+          console.error(`[worktree-base-directory-poller] repeated snapshot failures for ${target.key}`)
+        }
+      })
       .finally(() => {
         ticking = false
       })
   }, pollIntervalMs)

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 36ae6b93-c70d-4930-ad6e-763736150487

📥 Commits

Reviewing files that changed from the base of the PR and between 4dbc9f3 and 3beffc6.

📒 Files selected for processing (10)
  • src/main/emulator/serve-sim-state-watcher.test.ts
  • src/main/emulator/serve-sim-state-watcher.ts
  • src/main/ipc/filesystem-watcher-ignore.test.ts
  • src/main/ipc/filesystem-watcher-ignore.ts
  • src/main/ipc/filesystem-watcher.ts
  • src/main/ipc/worktree-base-directory-poller.test.ts
  • src/main/ipc/worktree-base-directory-poller.ts
  • src/main/ipc/worktree-base-directory-watcher.test.ts
  • src/main/ipc/worktree-base-directory-watcher.ts
  • src/main/runtime/file-watcher-host.ts

…ktree-metadata stream

- base targets: tick is now one stat of each gate dir (root + nested
  containers); the readdir + marker fan-out runs only when a gate dir
  changed, with a 30s ungated backstop and a bounded pending-marker
  recheck list. Idle tick 600us -> 1.1us at 146 worktrees.
- git-common targets on macOS: replace the 2s entry sweep with one narrow
  native stream on <common>/.git/worktrees (tiny, rare-churn tree): zero
  idle syscalls and external worktree add/remove/HEAD detection back to
  sub-second. Re-arms via existence poll across git worktree prune
  deleting/recreating the dir. Win/Linux keep the listing poll (no
  fseventsd there; a Windows dir handle could block prune).
- split git-common logic into worktree-git-common-watch.ts (max-lines).

Co-authored-by: Orca <[email protected]>
@nwparker
nwparker merged commit 7f1e280 into main Jul 2, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…ents streams (stablyai#7068)

* Cut fseventsd load: fix macOS exclusion cap, drop wide always-on FSEvents streams

- @parcel/watcher maps plain-path ignores to FSEventStreamSetExclusionPaths,
  but macOS caps exclusions at 8 per stream and fails closed. Orca passed 9,
  silently disabling ALL daemon-side exclusions: fseventsd delivered every
  node_modules/.git event to each per-worktree explorer stream (measured 16x
  client CPU). Cap plain paths at 8 (extras demoted to userspace globs) via a
  shared filesystem-watcher-ignore module, also unifying the runtime
  file-watcher host list so identical roots share one native stream.
- worktree-base-directory-watcher subscribed recursive FSEvents streams over
  every repo's ENTIRE workspace root (all worktrees) and whole common .git
  (objects included) with glob-only ignores (zero daemon-side exclusion),
  just to observe a few shallow paths. Replace with a 2s readdir/stat poller
  (zero fseventsd clients, measured 70x less delivery CPU); SSH targets keep
  provider.watch unchanged.
- serve-sim state watcher held an app-lifetime fs.watch on $TMPDIR (the
  noisiest dir on the system); its existing 250ms existence poll makes the
  parent watch redundant, so drop it.

Co-authored-by: Orca <[email protected]>

* Eliminate base-poller idle cost: mtime-gated ticks + narrow macOS worktree-metadata stream

- base targets: tick is now one stat of each gate dir (root + nested
  containers); the readdir + marker fan-out runs only when a gate dir
  changed, with a 30s ungated backstop and a bounded pending-marker
  recheck list. Idle tick 600us -> 1.1us at 146 worktrees.
- git-common targets on macOS: replace the 2s entry sweep with one narrow
  native stream on <common>/.git/worktrees (tiny, rare-churn tree): zero
  idle syscalls and external worktree add/remove/HEAD detection back to
  sub-second. Re-arms via existence poll across git worktree prune
  deleting/recreating the dir. Win/Linux keep the listing poll (no
  fseventsd there; a Windows dir handle could block prune).
- split git-common logic into worktree-git-common-watch.ts (max-lines).

Co-authored-by: Orca <[email protected]>

---------

Co-authored-by: Orca <[email protected]>
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