Commit Graph
1 Commits
Author SHA1 Message Date
yetone d17a0b3ca0 usage: opening the Usage page no longer stutters (_hii11 on Discord)
_hii11 (Discord #general): switching sidebar pages stutters a little,
most of all on Usage. The click that opened Usage built every allowance
card and curve twice, the first time inside the click:

- renderUsageLoading drew the cards again although the read of the
  allowances that goes with every load (loadQuotas) draws them once it
  answers. Cards already drawn now stay until then.
- every card's draw parsed each history line's readings (up to 6000 a
  window, 45 days) three times. quotaPoints parses a line once for each
  read of the history (loadQuotaHist puts a new quotaHist), and the
  recorded cycles are found once for those points.

The UI is the same; nothing new moves.

Measured on mote, headless Chromium, 1280x820, a busy user's data (10
accounts, 45 days of history, 30 days of usage), Usage clicked 4 times,
frames dropped in the 900ms after the click:
- CPU x1: before 4/4/1/1 (worst gap 50ms), after 1/1/0/1 (33ms)
- CPU x4: before 43/37/33/32, after 32/17/20/19; the click's own task
  ~250ms before, ~70-85ms after; click handling in the trace 303ms -> 89ms.
Agents and Providers switches were 0-1 dropped before and after.

Run (mote):
- usage-open-light.test.cjs (new), Chromium and WebKit, en/zh/zh-TW/ja/de:
  green. Red on the old assets: 17292 dates parsed again per redraw; with
  only page.js put back by hand, the cards are rebuilt inside the click.
- the 195 GUI files that touch the Usage page or its cards, both engines:
  3243 of 3295 pass. Each red file was then run alone on this change and
  on origin/main 4a9cfb52e: the same reds on main, all filed already:
  tray-cell-click #5215, usage-agents-hide #2276, usage-fold #3415,
  context-map #3488, codex-auto-reset (webkit de) #4790, usage-ledger
  Requests #5048. account-eye's '' for 'none' is #5052 (on main too;
  4 of 4 green here alone). plugin-checkin passed alone on both.
- quota-curve.test.cjs both engines green; TestCoreScriptBudget passes.

Not tried: the real app at 60fps (ffmpeg), WebKitGTK on Linux, Windows
WebView2, the reporter's own data.
2026-11-05 00:41:16 +08:00