Skip to content

perf(boot): cached login PATH, async recapture; no sync git in projects:list / listBranches (#1475) - #1479

Merged
currentbits merged 4 commits into
mainfrom
coder/perf-f-boot-path-capture-sync-git-62328e
Oct 5, 2026
Merged

currentbits merged 4 commits into
mainfrom
coder/perf-f-boot-path-capture-sync-git-62328e

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Part of #1475: main-process findings 3 and 4 in docs/perf/2026-10-05-main-process.md.

PATH capture no longer blocks boot

  • primeProcessPath applies the last launch's login-shell PATH (cached in userData/login-path.json) synchronously, with no shell.
  • The ~0.7–1.4 s $SHELL -lic capture now runs async after first paint and refreshes the cache.
  • Spawn ordering is preserved:
    • runner.startRun and startWorkflowRun await whenPathReady() before any spawn.
    • The memory supervisor (it probes kimi/cursor) starts after the capture.
    • On a first launch with no cache, providers:list waits for the capture before running which.
  • whenPathReady starts the capture itself if nothing has yet, so callers can't hang. The capture keeps its shell timeout and resolves to null on failure.

No sync git on the hot IPC paths

  • projects:list: the icon cache key reads the git common dir from disk (.git → gitdir: → commondir) instead of spawning git rev-parse per project.
  • git:listBranches: uses the async default-branch helper. The dead duplicate handler is dropped.

Measured independently (real $SHELL and HOME, read-only):

main this branch
PATH setup before window creation 1,370 ms (blocking $SHELL -lic, median of 3; PM1 measured 0.71 s on an idle machine) 0.64 ms with cache; 0.7 ms on first run, capture deferred

Tests

  • New: pathenv.test.js (cached apply, async refresh, first run, spawn waits), project-icon.test.js, and the base-branch additions.
  • Full electron suite (CI-like env): 4130/4132. The 2 failures are the known load flake in provider-usage.test.js, which passes 22/22 on its own.
  • npm run typecheck clean; npm run test:smoke A–E.

🤖 Generated with Claude Code

Willem and others added 4 commits October 5, 2026 20:19
… paint (#1475)

The $SHELL -lic PATH capture ran via execFileSync at main.js top level,
blocking window creation ~0.7 s on every launch. primeProcessPath now
applies the last captured PATH from userData/login-path.json; the capture
re-runs with async execFile once the window has painted (startMemory),
and startRun/startWorkflowRun await it before the first provider spawn,
so a first run or a changed rc file still gets the shell's PATH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1475)

projects:list ran execFileSync git rev-parse per project for the icon
cache key (138 ms at boot, again on every 60 s TTL lapse). Read .git /
gitdir / commondir directly instead. Key the cache on the project root
too, so two checkouts of one repo no longer share an icon entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er (#1475)

listBranchesAsync runs the default-branch probe and for-each-ref in
parallel off the event loop. The first git:listBranches key in ipc-git.js
was shadowed by the second and never ran; removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ly (#1475)

Without a cached PATH, the which-probe could report a CLI missing before
the async capture lands. Cached boots do not wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits merged commit 8ab3cef into main Oct 5, 2026
6 checks passed
@currentbits
currentbits deleted the coder/perf-f-boot-path-capture-sync-git-62328e branch October 5, 2026 18:45
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