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

Live triage's comment lookups use an issue index: 3.8 s → 11.5 ms per query #16713

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The forge's main JS thread spent 743 s in 3 h on 704 "slow statement" lines, up to 3.2 s at once.

Notes

shipped production is serving it deploy 354c752

opened this

The forge's main JS thread spent 743 s in 3 h on 704 "slow statement" lines, up to 3.2 s at once. The top cause: live triage's two per-issue comment lookups (questions, duplicates) in livetriage.ts planned through comment_author, so each of 249 open issues walked the triage user's 13,717 comments: 3.8 s per query on production.

  • Migration comment_issue_author (issue_id, author_id) with its pin. The same queries on production with the issue index: 11.5 ms (about 330x).
  • test/livetriage-plan.test.ts records every comment lookup a real triage pass runs and requires its plan to use the new index; fails on main.

Measured per thread on production: main JS about 30–35% of a core, one Worker about 24% (not yet identified), GC helpers about 5%, mi-scavenger about 6%. Next after this: the sampler's capRows (42 s per 3 h).

tsc, gate and 247 tests pass.

🤖 Generated with Claude Code

Approved

Clean. Additive, idempotent index comment_issue_author (issue_id, author_id) matches the two per-issue lookups in crew/livetriage.ts (c.issue_id = i.id AND c.author_id = ?). Migration has its pin, adds no code path, and no input, auth or output surface. The test reads the real query plans of the triage pass and fails without the index. It adds nothing to README, no dependency, and no dead code. No security findings.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs