Thread view: fetch only the stats it will use when walking down #312

Merged
littlefox merged 1 commit from issue-311-fetch-after-burst into main 2026-10-23 15:08:59 +00:00
Owner

Closes #311

The thread view's walk down asked for the stats and subject lines of the next 200 texts in one go, about 400 calls. On a slow CPU that took up a whole reading step; the perf budgets on #303 caught steps of 434 and 633 ms on CI. Now the view asks for stats only, and only as many as its 100-text cap leaves room for. The thread index still asks for 200 texts with their subject lines.

  • New: PERF_CPU=4 tools/perf.sh LABEL slows the browser's CPU 4× to reproduce CI's runners locally.
  • With the CPU slowed 4×: slowest step 353 → 247 ms; server calls for 300 steps 1122 → 972; no burst.
  • Giant, forks, footnotes, thread, thread-chat and thread-list specs: 36 passed with 30 ms latency. Lint passes all three ways; devserver tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8

Closes #311 The thread view's walk down asked for the stats and subject lines of the next 200 texts in one go, about 400 calls. On a slow CPU that took up a whole reading step; the perf budgets on #303 caught steps of 434 and 633 ms on CI. Now the view asks for stats only, and only as many as its 100-text cap leaves room for. The thread index still asks for 200 texts with their subject lines. - New: `PERF_CPU=4 tools/perf.sh LABEL` slows the browser's CPU 4× to reproduce CI's runners locally. - With the CPU slowed 4×: slowest step 353 → 247 ms; server calls for 300 steps 1122 → 972; no burst. - Giant, forks, footnotes, thread, thread-chat and thread-list specs: 36 passed with 30 ms latency. Lint passes all three ways; devserver tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Thread view: fetch only the stats it will use when walking down
All checks were successful
ci / check (push) Successful in 9m11s
ci / desktop (push) Successful in 15m9s
ci / e2e (push) Successful in 34m40s
9fab7ab347
When the walk down a chain leaves what's cached, fetch_after asked for
the stats and subject lines of the next 200 texts: about 400 calls at
once. A slow CPU (CI's runners, a phone) spends a whole step parsing
them; the perf budgets (#287) caught a 434 and then a 633 ms step on CI
where it used to be 220. The thread view shows at most 100 texts and
looks only at stats, so it now asks for stats only, as many as its cap
leaves room for. The thread index keeps 200 with subjects.

With the CPU slowed 4x (PERF_CPU, new): slowest step 353 -> 247 ms,
calls for 300 steps 1122 -> 972, no burst.

Closes #311

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
littlefox referenced this pull request from a commit 2026-10-24 13:23:56 +00:00
Sign in to join this conversation.
No description provided.