Qualify chat profiling evidence and controlled streaming workload

This commit is contained in:
2026-11-07 22:16:29 +00:00
parent 11e25f6a5f
commit 1af69c1bca
2 changed files with 22 additions and 9 deletions
+21 -8
View File
@@ -6,15 +6,14 @@ Diagnostic-only profile of the real `ChatThreadView` with its isolated fake
`ApiGateway` (`tool/chat_composer_probe_entry.dart`). The synthetic transcript
contains prose, headings, inline emphasis/code, fenced Dart, links, lists and a
3-column Markdown table; the stream adds 80 incremental text updates. This is a
focused widget fixture rather than a full shell/session-list capture. Runs were
made in a quiet worktree on release web, headless Chrome at 560x1000 with
focused widget fixture rather than a full shell/session-list capture. Runs used an isolated worktree on release web, headless Chrome at 560x1000 with
software rasterisation. These are Chrome wheel/software-raster comparison
numbers, not Android FPS; no authorized Android device was connected.
## Reproduction
From `app/`, after checking that no competing Flutter build, test or capture was
running:
From `app/` (for a reproducible follow-up, first verify and record that no
competing Flutter build, test or capture is running):
```sh
/Users/alan/development/flutter/bin/flutter build web --release \
@@ -53,10 +52,13 @@ software Chrome harness, not a device refresh-rate assertion.
ms while raster p50 is about 25 ms. These numbers cannot identify whether
text, tables, selection, or CanvasKit compositing owns the raster cost, so
they do not justify a Markdown rewrite.
2. **Measured: the long live answer costs more build time.** Stream build p50 is
4.8 ms for 300 messages versus 1.3 ms for 20. This is consistent with the
growing live Markdown turn and text layout, but it is not isolated proof that
Markdown parsing alone is responsible.
2. **Measured: the same streamed reply costs more build time with longer
history.** Stream build p50 is 4.8 ms for 300 history messages versus 1.3 ms
for 20. Both workloads append the same 80 short word deltas to a new reply;
answer length is controlled. This is correlation with history size, not
evidence of a longer answer or of Markdown parsing as the cause. Per-update
transcript/row projection, cache lookup and text/selection layout are next
candidates to isolate.
3. **Measured: opening history is not strongly message-count-sensitive here.**
Open build and total medians are effectively unchanged from 20 to 300 rows.
The transcript uses the existing row construction and `ChatMarkdownCache`;
@@ -79,3 +81,14 @@ No production code or behavior was changed. Selection/copy, rich Markdown,
scroll anchors and drafts remain unchanged. No app tests were run because this
visit changed only profiling fixture/probe code and a note; `node --check` and
the release build succeeded.
## Manager evidence qualification
The collected samples are directional. The original handoff did not retain a
resource-contention log for every sample, and other project work was active
during this session; isolated worktrees alone do not establish a quiet CPU.
Do not treat these values as a fully isolated native performance diagnosis.
A follow-up should save contention checks with raw sample reports and use CPU
attribution to distinguish row projection, text layout and raster/compositing.
The full-app touch capture validates scrolling interaction separately; the
timing table above measures wheel input in the isolated ChatThreadView fixture.
+1 -1
View File
@@ -19,7 +19,7 @@ import { serveBuild } from './capture/serve.mjs';
const [dir, messagesArg = '300', deltasArg = '200', repeatsArg = '3'] = process.argv.slice(2);
if (!dir) {
console.error('usage: node tool/chat_perf_probe.mjs <build dir> [messages] [deltas]');
console.error('usage: node tool/chat_perf_probe.mjs <build dir> [messages] [deltas] [repeats]');
process.exit(2);
}
const messages = Number(messagesArg);