2.5 KiB
Chat visible-row construction
Finding and change
Every transcript delta projected the history and eagerly called _transcriptRow
for every row, creating permission/question chip inputs and walking cached row
content even when the row was far outside the viewport. Sliver layout was
already lazy, but this construction work happened before slivers could skip it.
A row-local Builder defers that construction until the sliver mounts the row.
All rows, row keys, split anchors, selection, disclosures and Markdown rendering
remain in the existing path. No Markdown subset, font or table layout changed.
Controlled comparison
Release web tool/chat_composer_probe_entry.dart, software Chrome at 560x1000,
300 history messages, the same 80 streamed text updates, and 120 wheel gestures.
Alternating baseline/candidate/baseline/candidate, each with fresh phase pages.
Baseline is 7ce4b1e6 (7287ba35 plus the preserved profiling tooling); candidate
diff is the row-local Builder only. Other lanes held compiles/tests/captures
for the four measured runs. Preliminary contended measurements were excluded.
Means of the two per-run statistics, milliseconds:
| phase | baseline build mean / p90 | candidate build mean / p90 | baseline / candidate raster mean |
|---|---|---|---|
| open | 2.41 / 4.45 | 2.15 / 3.40 | 25.34 / 26.05 |
| wheel scroll | 2.21 / 6.55 | 2.25 / 6.70 | 21.32 / 21.30 |
| stream | 3.21 / 5.95 | 2.27 / 3.80 | 21.08 / 21.09 |
Streaming build mean is about 29% lower and build p90 about 36% lower here.
Scroll and software-raster cost are effectively unchanged. This is a focused
widget fixture, not full-shell timing or Android FPS evidence. Native hardware
was unavailable. The change reduces a measured source of streaming overhead;
it does not explain or claim to eliminate all perceived chat heaviness.
Raw JSON and summary are in ignored app/build/perf-evidence/ and the private
/tmp/chat-perf-quiet/ capture output.
Checks
Conversation + transcript suite: 644 passed, one stale narrow Cupertino label
assertion failed (/tmp/memwatch/out.AEK2gT). That assertion required visible
permission text, conflicting with the user's shipped icon-only header. Updated
it to require no visible label while retaining current-value semantics and the
permission-sheet interaction. Its complete 10-test file passed after the change
(/tmp/memwatch/out.xWOzXj). Analyzer clean (flutter-analyze.uyyFoA).
The existing suite covers long-history lazy mounting, paging/anchors, live
updates, selection/copy, horizontal code/table scrolling and disclosure retention.