Turtle
5329bef04d
perf(tui): incremental step timing and card render caches for long sessions
...
Resuming a long session (196k events, 2.2k steps, 1.8k tool cards) took
~12s to render and ~800ms to echo one keystroke:
- Every step's timing footer called stepTimingAt, which replayed the whole
event log per footer - O(steps x events) on the initial render.
- pi-tui re-renders every component each frame and relies on per-component
line caches, but ToolCardComponent/ContextCardComponent built throwaway
Text/Markdown instances inside render(width), re-wrapping every settled
card's output on every keystroke.
Replace the per-footer replay with one shared StepTimingTracker per chat
mount (single O(events) cursor over the append-only log), and cache card
rows by width via CardLineCache, dropped by every state mutator and
invalidate().
Measured (tmux 200x50, 196k-event session): resume prompt-ready ~12s -> ~7.6s;
per-keystroke echo ~800ms median -> ~11ms.
2026-08-04 00:37:10 +08:00
..
2026-07-25 16:43:07 +08:00
2026-07-25 16:43:07 +08:00
2026-07-25 16:43:07 +08:00
2026-08-02 01:25:01 +08:00
2026-08-02 01:25:01 +08:00
2026-08-02 01:25:01 +08:00
2026-07-27 17:38:42 +08:00
2026-07-27 17:38:42 +08:00
2026-07-27 17:38:42 +08:00
2026-07-25 15:11:17 +08:00
2026-07-25 15:11:17 +08:00
2026-07-25 15:11:17 +08:00
2026-07-24 22:38:50 +08:00
2026-07-24 22:38:50 +08:00
2026-07-24 22:38:50 +08:00
2026-07-27 23:41:27 +08:00
2026-07-27 23:41:27 +08:00
2026-07-27 23:41:27 +08:00
2026-07-27 18:53:29 +08:00
2026-07-27 18:53:29 +08:00
2026-07-27 18:53:29 +08:00
2026-07-27 18:55:13 +08:00
2026-07-27 18:55:13 +08:00
2026-07-27 18:55:13 +08:00
2026-07-25 16:05:05 +08:00
2026-07-25 16:05:05 +08:00
2026-07-25 16:05:05 +08:00
2026-07-24 12:21:10 +08:00
2026-07-24 12:21:10 +08:00
2026-07-24 12:21:10 +08:00
2026-07-27 18:55:13 +08:00
2026-07-27 18:55:13 +08:00
2026-07-27 18:55:13 +08:00
2026-07-30 21:14:03 +08:00
2026-07-30 21:14:03 +08:00
2026-07-30 21:14:03 +08:00
2026-07-27 21:11:15 +08:00
2026-07-27 21:11:15 +08:00
2026-07-27 21:11:15 +08:00
2026-07-27 15:46:40 +08:00
2026-07-27 15:46:40 +08:00
2026-07-27 15:46:40 +08:00
2026-07-27 18:55:13 +08:00
2026-07-27 18:55:13 +08:00
2026-07-27 18:55:13 +08:00
2026-07-27 18:55:13 +08:00
2026-07-27 18:55:13 +08:00
2026-07-27 18:55:13 +08:00
2026-07-28 22:16:43 +08:00
2026-07-28 22:16:43 +08:00
2026-07-28 22:16:43 +08:00
2026-07-30 18:08:22 +08:00
2026-07-30 18:08:22 +08:00
2026-07-30 18:08:22 +08:00
2026-08-02 00:49:58 +08:00
2026-08-02 00:49:58 +08:00
2026-08-02 00:49:58 +08:00
2026-07-28 12:36:29 +08:00
2026-07-28 12:36:29 +08:00
2026-07-28 12:36:29 +08:00
2026-08-01 22:15:36 +08:00
2026-07-29 11:22:48 +08:00
2026-08-01 22:15:36 +08:00
2026-07-30 21:59:33 +08:00
2026-07-30 21:59:33 +08:00
2026-07-30 21:59:33 +08:00
2026-07-29 00:45:52 +08:00
2026-07-29 00:45:52 +08:00
2026-07-29 00:45:52 +08:00
2026-07-29 21:03:40 +08:00
2026-07-29 21:03:40 +08:00
2026-07-29 21:03:40 +08:00
2026-07-30 14:42:39 +08:00
2026-07-30 14:42:39 +08:00
2026-07-30 14:42:39 +08:00
2026-07-30 18:35:20 +08:00
2026-07-30 18:35:20 +08:00
2026-07-30 18:35:20 +08:00
2026-08-02 12:45:36 +08:00
2026-08-02 12:45:36 +08:00
2026-08-02 12:45:36 +08:00
2026-07-31 15:06:27 +08:00
2026-07-31 15:06:27 +08:00
2026-07-31 15:06:27 +08:00
2026-07-30 17:59:37 +08:00
2026-07-30 17:59:37 +08:00
2026-07-30 17:59:37 +08:00
2026-07-30 15:06:28 +08:00
2026-07-30 15:06:28 +08:00
2026-07-30 15:06:28 +08:00
2026-07-31 15:11:24 +08:00
2026-07-31 15:11:24 +08:00
2026-07-31 15:11:24 +08:00
2026-07-30 14:42:39 +08:00
2026-07-30 14:42:39 +08:00
2026-07-30 14:42:39 +08:00
2026-07-31 10:11:54 +08:00
2026-07-31 10:11:54 +08:00
2026-07-31 10:11:54 +08:00
2026-07-31 13:13:50 +08:00
2026-07-31 13:13:50 +08:00
2026-07-31 13:13:50 +08:00
2026-07-31 01:36:20 +08:00
2026-07-31 01:36:20 +08:00
2026-07-31 01:36:20 +08:00
2026-08-03 14:14:20 +08:00
2026-08-03 14:14:20 +08:00
2026-08-03 14:14:20 +08:00
2026-07-31 05:41:45 -07:00
2026-07-31 05:41:45 -07:00
2026-07-31 05:41:45 -07:00
2026-07-31 18:37:08 +08:00
2026-07-31 18:37:08 +08:00
2026-07-31 18:37:08 +08:00
2026-08-03 21:13:52 +08:00
2026-08-03 21:13:52 +08:00
2026-08-03 21:13:52 +08:00
2026-07-31 18:37:34 +08:00
2026-07-31 18:37:34 +08:00
2026-07-31 18:37:34 +08:00
2026-08-03 16:49:18 +08:00
2026-08-03 16:49:18 +08:00
2026-08-03 16:49:18 +08:00
2026-08-02 12:51:10 +08:00
2026-08-02 12:51:10 +08:00
2026-08-02 12:51:10 +08:00
2026-08-02 05:58:45 -07:00
2026-08-02 05:58:45 -07:00
2026-08-02 05:58:45 -07:00
2026-08-03 16:19:49 +08:00
2026-08-03 16:19:49 +08:00
2026-08-03 16:19:49 +08:00
2026-08-02 13:26:08 +08:00
2026-08-02 13:26:08 +08:00
2026-08-02 13:26:08 +08:00
2026-08-03 14:14:20 +08:00
2026-08-03 14:14:20 +08:00
2026-08-03 14:14:20 +08:00
2026-08-04 00:37:10 +08:00
2026-08-04 00:37:10 +08:00
2026-08-04 00:37:10 +08:00