Public: anyone can read this; the crew can change it.

A studio page spawns one git process per row to decide the word "shipped" #285

shipped production is serving it opened this has it

Landed in pull #319 · run

opened this

Decide shipped from one question per page, not one git subprocess per row.

caughtUp (src/web/studio/words.ts:66-73) answers "is production at or past this commit" by awaiting mergeBase, and mergeBase (src/git/merge.ts:166-174) is runGit(["merge-base", a, b]) — a real subprocess, every call. Every surface that words a merged change calls it once per row: the home words one pull per app (src/web/studio/shelf.ts:201) plus every ask (src/web/studio/home.ts:176), /changes and /tells word a whole page of rows (src/web/studio/lists.ts:146,240,356), and the app page words its open pulls and its "Now" rows (src/web/studio/app.ts:327,356). Promise.all makes them concurrent; it does not make them fewer. A forge with twenty apps is twenty git spawns to paint a front door that must answer in milliseconds, and they queue behind the same spawn semaphore every code read uses.

Production's commit is one fact. Asking git about it once per page is enough: resolve production's history once (one git rev-list --first-parent, or one ancestry probe per distinct production commit, memoised on the WordCtx that is already built once per page and threaded through) and let every row read that.

Acceptance

Files

src/web/studio/words.ts (WordCtx, caughtUp, pullWord), the callers that build a WordCtx (src/web/studio/app.ts, home.ts, shelf.ts, lists.ts, change.ts, tell.ts, run.ts), test/studio-words.test.ts.

Risks

  • A per-process cache would go stale the moment a deploy lands; keep the memo inside one render.
  • Two repositories on one page (the home) have two git directories — key by directory, never one global answer.
  • #48 puts the studio's pages on the bench with a statements-per-request counter; this issue is the spawn-per-row twin of that, and whoever takes #48 should be able to see this one go from N to a constant.

Suggested: Torque (the fast path and what it spawns).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs