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

P0: /board refetches every 2.5 s and costs half the main thread; fix the stalls the profiler found #8150

Closed opened this

Pull #8151 was closed

opened this

From the profiler (#8108) and the access log, 2026-11-02 04:16Z: stalls are 20 a minute, worst 25 s.

1. /board: 51% of main-thread samples. One signed-in Safari tab made 361 GETs in 15 minutes, every 2.5 s, 1.7 s each. Inside it: returnsStrip 29% (tokenReturns, returns.ts:187, then pillarOfIssue 123,000 calls a minute with the closesFromBody regex), forgeNotes → heldChecks 9.5%, today → plannerHold → readyNow → holdsUpMap 11%. 2. diskBytes (apps/contain.ts:943): synchronous lstat walk, 9.4%. 3. rmSync in apps/runtime.ts:1228 execute: 6.9%. 4. The statement tally (slow_sql.ts:95, callers): 8.1%: a stack per statement. 5. The profiler (perf/sample.ts) stays attached until restart, so a sample leaves the forge slower: stop it at the end of the sample, or only sample in a way that can stop.

Do in this order, separate small pulls, land each at once:

  1. A live page never refetches per event. At most one refetch per 30 s per tab, none while hidden; serve /board from the stale-while-revalidate cache home uses. Check other live pages for the same pattern. Do this first: it is half the problem.
  2. Sample the tally (1 in 50) and make the profiler detach.
  3. tokenReturns: one joined query in place of N+1 pillarOfIssue; store closes-from-body instead of re-parsing it.
  4. diskBytes and rmSync off the main thread.

Done when: stalls over 500 ms are under 5 in 10 minutes with a /board tab open at this load. Paste before and after here. Name each pull Part of this issue, not Closes, until the last.

commented

Closed: already done on main in 8b9a3497 (pull #8151).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs