Neil
28d936e030
perf(native-chat): bound journal reads during paged catch-up ( #19360 )
...
* perf(native-chat): bound journal reads during paged catch-up
* perf(native-chat): reduce the journal once per catch-up run, not per page
Bounding the SQL read per page left the JS side still O(total items) per
page: every page re-reduced the whole timeline and rebuilt the live-item
map, and the byte-shrink loop rebuilt it again on each halving.
A catch-up run is a synchronous loop with no await between pages, so the
reduced timeline is loop-invariant. `createAgentSessionCatchUpReader`
holds one snapshot for the run and re-reduces only if the journal cursor
actually moved, and the projection's live-item / alias / submission-byte
indexes memoize on the snapshot arrays the reducer rebuilds on change.
Per catch-up over a 8,000-message backlog: 40 timeline reductions to 1,
reduce+project time 24.3ms to 3.5ms, end-to-end 134.6ms to 111.3ms.
2026-09-07 23:24:25 -07:00
..
2026-09-07 23:24:25 -07:00
2026-09-07 23:24:25 -07:00
2026-09-04 15:55:20 -07:00
2026-09-04 15:55:20 -07:00
2026-08-12 13:09:08 -07:00
2026-09-06 14:34:03 -04:00
2026-09-06 14:34:03 -04:00
2026-08-13 01:12:19 -07:00
2026-08-13 01:12:19 -07:00
2026-09-04 15:55:20 -07:00
2026-08-30 01:49:05 -07:00
2026-09-06 14:34:03 -04:00
2026-09-06 14:34:03 -04:00
2026-09-04 15:55:20 -07:00
2026-09-06 14:34:03 -04:00
2026-09-04 15:55:20 -07:00
2026-09-04 15:55:20 -07:00
2026-09-06 23:24:21 -07:00
2026-09-06 23:24:21 -07:00
2026-07-10 13:16:55 -07:00
2026-07-10 13:16:55 -07:00
2026-08-13 00:54:19 -07:00
2026-08-30 01:49:05 -07:00
2026-07-17 15:59:38 -07:00
2026-08-25 15:47:40 -07:00
2026-08-31 23:27:56 -07:00
2026-09-04 23:42:43 -07:00
2026-09-06 16:28:10 -07:00
2026-09-06 16:28:10 -07:00
2026-07-10 13:16:55 -07:00
2026-08-07 00:58:29 -07:00
2026-07-10 13:16:55 -07:00
2026-08-07 00:58:29 -07:00
2026-08-07 00:58:29 -07:00
2026-07-20 23:57:05 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 23:20:24 -07:00
2026-08-29 14:13:35 -07:00
2026-08-18 16:57:35 -07:00
2026-09-04 23:42:43 -07:00
2026-08-18 23:20:24 -07:00
2026-07-23 18:35:31 -07:00
2026-08-13 00:54:19 -07:00
2026-06-28 15:43:07 -07:00
2026-08-13 00:54:19 -07:00
2026-08-13 00:54:19 -07:00
2026-08-18 16:57:35 -07:00
2026-08-10 18:32:26 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-07-17 15:59:38 -07:00
2026-07-17 15:59:38 -07:00
2026-07-17 15:59:38 -07:00
2026-08-30 01:49:05 -07:00
2026-08-25 15:06:47 -07:00
2026-08-30 01:49:05 -07:00
2026-08-30 01:49:05 -07:00
2026-08-31 13:22:20 -07:00
2026-08-29 01:45:20 -07:00
2026-08-30 01:49:05 -07:00
2026-07-20 23:57:05 -07:00
2026-08-25 15:06:47 -07:00
2026-07-20 23:57:05 -07:00
2026-08-30 01:49:05 -07:00
2026-08-30 01:49:05 -07:00
2026-07-17 15:59:38 -07:00
2026-08-30 01:49:05 -07:00
2026-08-30 01:49:05 -07:00
2026-08-30 01:49:05 -07:00
2026-08-26 12:38:59 -07:00
2026-08-10 02:19:16 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-18 16:57:35 -07:00
2026-08-30 01:49:05 -07:00
2026-08-30 01:49:05 -07:00
2026-08-30 01:49:05 -07:00