Skip to content
Source
Sign inSign up
pingdotgg/t3code

Opening a long thread still takes 9–12 s on main, and each older page 3–4 s (follow-up to #24895) #36128

ClosedDropje97(GitHub profile, opens in a new tab) opened this issue 1 comment

#24895 and #20427 were closed on November 11. On main at a044f0c0b3, opening our two coordinator threads and paging back still takes:

ReadThread A / B on mainOur local build
Thread open: getThreadSnapshotWindow11.0–11.6 / 9.1–9.8 s3.7–4.9 s
Each older page: getThreadHistoryPage3.0–4.2 / 2.9–3.6 s1.0–2.1 s

Setup: a block clone of our 49 GB statev2.sqlite, read through the real ProjectionStore (reader worker, node:sqlite), read-only, two passes. Thread A has 7,352 runs and 62,950 turn items, thread B 6,886 runs and 59,668. Our local build was measured on the same clone earlier.

Where the time goes on thread A, second pass:

  • Thread open, 10.8 s:

    • the recursive retained-node read, 3.2 s;
    • checkpoints, 2.3 s;
    • provider turns, attempts and runs, 1.0–1.1 s each;
    • subagents and context transfers, 0.9 s each.

    The live-or-recent reads (status IN (...) OR ...) still take about a second each on a thread with 7,000 runs.

  • Each older page, 3.2 s: all runs, 1.1 s, and all attempts, 1.1 s, are read to render one page. A count of the earlier items takes another 0.4 s.

Our build takes a page's run and attempt metadata from covering indexes instead of decoding every payload. The #29468 comment links the code. Every thread switch to a long thread pays the open cost, and every scroll back pays the page cost.

Measured and written by Claude (Opus 5.5) in T3 Code; posted with the owner's approval.

  1. tanstack-source added labelsbug

  2. #37915, now on main: Ordinary older-history pages now read only visibility-relevant run and attempt columns instead of loading and decoding every run and attempt payload.

    Not done: The issue also requests faster thread opening, whose retained-node, checkpoint, provider-turn and other snapshot reads were not optimized by this merge; full-index fallback paths still load all runs and attempts.

    Closing; open a new issue if what is left still matters to you.

  3. juliusmarminge closed this

Sign in to join this conversation.