Repository navigation
improve(ui): speed up populated Usage timelines - #146947
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 6:52 AM ET / 10:52 UTC. ClawSweeper reviewWhat this changesReuse one timestamp formatter per Usage chart render to reduce populated-timeline rendering work while preserving localized tooltips and UTC selection. Merge readiness✅ Ready for maintainer review The optimization remains useful and is not implemented on current main or the latest release. No introduced correctness or security defects were found; the protected maintainer PR should remain open for normal landing. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI receives session usage points from the Gateway and renders an interactive timeline. Its timestamp formatter supplies tooltip and accessibility labels using the selected timezone and current locale. flowchart LR
A[Gateway usage points] --> B[Date and interval filters]
B --> C[Usage timeline render]
D[Locale and timezone] --> E[Render-scoped formatter]
C --> E
E --> F[Tooltip and accessibility labels]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1, Tests +69. Total +70 across 5 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep formatter reuse local to each chart render, preserving timestamp fields, invalid-date labels, and next-render locale and timezone refresh. Do we have a high-confidence way to reproduce the issue? Yes for the repeated-work mechanism: current main formats each populated chart point separately during every render. The reported timing magnitudes were not independently reproduced. Is this the best way to solve the issue? Yes: extending the existing formatter and sharing it within one render removes repeated setup without creating persistent cache state or changing existing callers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e9c1cb7e71b7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* temp/pr-146802: (51 commits) improve: reduce worktree filesystem stalls and archive syncs (#146906) fix(ui): avoid extra chat rail work while replies stream (#146883) improve(ui): speed up populated Usage timelines (#146947) test(gateway): retain auth recovery failure diagnostics (#146925) fix(tests): create private temporary home directories (#146931) fix(backup): preserve discovery under concurrent state writes (#146912) fix: keep queued deliveries in their original state directory (#146917) fix(discord): settle voice waveform work before releasing input (#146885) fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) ...
* commit 'ccfd2377cd07d1ad3a583ba64d08e29a065f7061': (1587 commits) fix(ui): avoid recapturing chat drafts during UI updates (#146884) fix(ui): show system uptime in the debug overlay (#146960) fix(retry): honor waits beyond the native timer limit (#145718) fix(ui): keep chat history idle when run status changes (#146802) fix(ui): reuse persisted text during chat streaming (#146831) refactor(qa): share harness drift result construction (#146903) test(agents): coordinate settings lock contention (#146949) fix(worker): avoid repeatedly serializing screenshot history (#146907) fix(secrets): stop buffered upload writes after cancellation (#146840) perf(doctor): avoid unnecessary state runtime imports (#146926) improve: reduce compaction request estimation work (#146961) fix(ci): wait for forwarded avatar imports before assertions (#146729) perf(workers): skip configured Git author lookups (#146833) fix: admit borrowed memory writes through the agent database owner (#146760) fix(discord): prevent voice playback gaps and stale turn controls (#146798) improve: reduce worktree filesystem stalls and archive syncs (#146906) fix(ui): avoid extra chat rail work while replies stream (#146883) improve(ui): speed up populated Usage timelines (#146947) test(gateway): retain auth recovery failure diagnostics (#146925) fix(tests): create private temporary home directories (#146931) ... # Conflicts: # test/tsconfig/tsconfig.core.test.agents-other.json # test/tsconfig/tsconfig.core.test.agents-root.json
Closes #146932
What Problem This Solves
Populated Usage timelines repeatedly format every point's timestamp while the page updates.
User Impact
Loaded timelines with 50–200 points take less CPU to render while preserving localized labels, UTC selection, and existing interactions. Small and invalid-only cases have mixed results, including measured increases below 1 ms per render; this is not a universal page speedup.
Why This Change Was Made
The chart reuses the existing timestamp formatter for one render. Explicit chart fields and UTC options remain local to that render, while existing no-argument callers keep minute precision and the next render picks up locale or system timezone changes.
Evidence
canonicalProviderNameandlistPackagedStaticExtensionAssetOutputs), previously reproduced on a clean campaign baseline; the production unused-export scan passed.aebd13d43300f9f7b48f55d0bec4fc0f0143c259, including all seven browser shards and the real-Gateway UI flow.Measurement scope and adverse controls
The benchmark measures the incremental chart change over the already optimized timestamp-list renderer. Both variants share the same independently reviewed DST repair; that repair's effect is not attributed to this optimization. Each process runs the same 31 timing cells and 33 parity cases, with three warmups and three alternating paired rounds of two complete renders.
These are synchronous Lit/jsdom renders, excluding browser paint, layout, network and module startup. Cold means a fresh DOM mount in a warm process. Warm means updating draft state on an existing page. Locale, selected timezone, cursor and mode transitions also have parity coverage.
The minimum two-point chart with 50 conversation entries regressed on all three processes: 1.397 to 1.728 ms on Node 24 and 1.271 to 1.436 ms on Node 26. One-point bypass cases also regressed. Node 26 invalid-only rows increased by 0.401–0.469 ms. Cold results are mixed; all empty, small, invalid and filtered-out cases remain in the retained evidence.
Both variants, imports, parity checks and DOM churn share each measured process. Whole-process peak RSS was 1232.78–1283.85 MiB on Node 24 and 1155.64–1347.69 MiB on Node 26; it does not establish a per-variant memory or retained-allocation improvement.
All 31 timing controls
Times are medians of three process medians in milliseconds. Wins compare paired process medians and all nine paired rounds; positive changes mean slower. Ordinary cells use UTC; local, French and DST names identify the additional conditions. Local/French/DST rows include 50 conversation entries; French and DST rows have 200 points.