From 2f6c3b7f7e157fde15b71762c64a3b901a6639b1 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Sun, 22 Nov 2026 18:38:29 +0000 Subject: [PATCH] Record the first round's measured gains in the 4K perf notes Co-Authored-By: Claude Opus 5.5 --- app/notes/perf-4k-chat.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/notes/perf-4k-chat.md b/app/notes/perf-4k-chat.md index 3a2e6a26..426ed2eb 100644 --- a/app/notes/perf-4k-chat.md +++ b/app/notes/perf-4k-chat.md @@ -78,3 +78,28 @@ timeline) in the self-time lists are measurement overhead. 7. **Typing**: a `LayoutBuilder` subtree above the composer rebuilds on every keystroke (166 ms over 74 keys, about 2 ms each), and the draft is written to preferences per keystroke (3 ms total). Low priority. + +## After the first round (same bench, 2026-11-22) + +CPU inside each hotspot, before -> after (first-repetition CPU profile): + +| Hotspot | Scenario | Before | After | +| --- | --- | --- | --- | +| Spinner controller lookup (`AppSpinner`) | stream | 139 ms | 0.5 ms | +| Selection ordering (`ChatTranscriptRowSelection`) | scroll | 241 ms | 85 ms | +| Selection ordering | switch | 84 ms | 67 ms | +| Table cell measuring (`ChatTableCellMeasure`) | scroll | 143 ms | 105 ms | +| Table cell measuring | switch | 61 ms | 30 ms | +| Per-delta rows (`ChatTranscriptRows`) | stream | 86 ms | 27 ms | +| Running composer border | stream | 602 ms | 621 ms (unchanged) | + +Frame-level medians barely moved (scroll still 38 frames over 16 ms; stream +build p50 3.0 ms): at 4K with a GPU these costs were spread thin, and the +frames that miss 16 ms are dominated by layout of newly built rows. + +The border is not fixed: keeping the measured outline (and, tried and +dropped, keeping every lap position's extracted paths) saves nothing on the +web, because the engine rebuilds each drawn `Path` from its recorded +operations (`LazyPath.builtPath` -> `extractPath` -> `CkPath`) every time it +is drawn. Fixing it needs a path-free drawing, e.g. the pill's rounded rect +drawn with a gradient shader that lights only the highlight.