Give a part of the page its own view only for a reason (#31)
#31 measured that an uncached child view renders again with its parent and saves nothing, and that caching the charts saved about 0.1 ms per hovered frame and nothing on window moves. A part gets a view when it owns state that changes on its own, or as a measured, tested cache; other parts render as functions in their parent's render. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #40.
This commit is contained in:
1 parent
8318a5875e
commit
e1ff92185a
2 files changed
+2
-1
No files matched your search
@@ -5,6 +5,7 @@ The app must stay as fluid and light as possible: it never feels slow and never
|
||||
- Any change that touches rendering, background work or memory measures before and after with the probes, on a release build (`scripts/prod`) on the reference machine, and records the numbers on its ticket. Debug numbers never count.
|
||||
- A change that exceeds a budget is not done. When a budget is beaten durably, lower it in `docs/performance.md` (ratchet); never raise it.
|
||||
- Do not modify GPUI or gpui-component to meet a budget: reduce the app's own rendering cost (ADR-0004).
|
||||
- A part of the page gets its own view for a reason: it owns state that changes on its own (the champion table: sort, selection, scroll, hover), or it is a cached view with a measured gain and a structural test (`docs/performance.md`). Other parts render as functions in their parent's render.
|
||||
|
||||
## Agent skills
|
||||
|
||||
|
||||
+1
-1
@@ -37,6 +37,6 @@ Every change that touches rendering, background work or memory measures before a
|
||||
- **Champion table hover**: `powershell.exe -ExecutionPolicy Bypass -File scripts/hover-probe.ps1 -Title "Arena Tracker"` from WSL, with the statistics page showing the table under the default band (adjust `-Top` and `-Bottom` otherwise). After an idle phase, it posts synthetic mouse moves across table rows 240 times per second without touching the real cursor. Compare `HOVER cpu` with `IDLE cpu`; `HOVER ping` shows how long input waits behind the UI thread while hovering (budget 1). The default band is `-X 0.25 -Top 0.62 -Bottom 0.95 -Step 0.04` (fractions of the client area, about one row per move in a window at least 800 px tall). Leave the real cursor still over the window, outside the table: when it is outside the window, GPUI sees each synthetic move as the mouse entering then leaving, and refreshes the whole window, bypassing cached views.
|
||||
- **Where a frame goes**: build with `scripts/prod build --features profile` (never for everyday use) and start the app with `ARENA_TRACKER_PROFILE=<file.csv>` (from WSL, pass it through `WSLENV`, e.g. `WSLENV=ARENA_TRACKER_PROFILE/p:ARENA_TRACKER_HIDE`). Every second it appends the frames GPUI drew (`draw`: total, `request_layout`, `prepaint`, `paint` in ms), their presentation (`present`) and the views' own time (`view`, recorded by GPUI from 0.5 ms). `ARENA_TRACKER_HIDE=<parts>`, read at start, removes parts of the page so that a part's cost is the difference with the full page under the hover probe: `header`, `banners`, `tiles`, `placements`, `completed`, `attempts` (the three charts keep their height), `tabs`, `table`.
|
||||
- **Memory**: working set of `arena-tracker.exe` in Task Manager, or `Get-Process arena-tracker` in PowerShell, once the page is fully loaded.
|
||||
- **CI cannot check budgets**: its runner is Linux without a GPU, and the app only builds on Windows (ADR-0003). When a change relies on cached views to stay within budget, a structural test (for example, "hovering the table does not render the charts") guards it instead of a timed test. The charts row is the page's one cached view (#31). A cached view is laid out from its style alone, never its content, so only a part whose size does not depend on its content can be one.
|
||||
- **CI cannot check budgets**: its runner is Linux without a GPU, and the app only builds on Windows (ADR-0003). When a change relies on cached views to stay within budget, a structural test (for example, "hovering the table does not render the charts") guards it instead of a timed test. The charts row is the page's one cached view (#31). A cached view is laid out from its style alone, never its content, so only a part whose size does not depend on its content can be one. A view that is not cached renders again with its parent and saves nothing, while its state must be kept in sync; a window move bypasses every cache.
|
||||
|
||||
GPUI and gpui-component are not modified to meet a budget: the app's own rendering cost is the lever (ADR-0004).
|
||||
Reference in new issue
Block a user