resetClock and resetText called toLocaleTimeString/toLocaleDateString/
toLocaleString, which build a new Intl formatter on every call. The Usage
page says every account window's reset on each render, so 600 accounts
made thousands of formatters per render.
dateFmt(opts) in i18n.js keeps one Intl.DateTimeFormat per intlLang() and
options. resetText's past time gives toLocaleString's default
fields (year/month/day/hour/minute/second numeric) by name, which is
what toLocaleString uses when given no options.
Probe (mote, 600 accounts open, W=520, names wrapping, 8 renders,
median sync ms, before → after):
WebKit ~431 → ~377
Chromium ~327 → ~279
Test: reset-clock-formats.test.cjs compares resetClock and resetText
with what the old toLocale*String code said word for word. It covers a
time every 5h from a week back to eight days ahead, in en, zh, zh-TW,
ja, de and then system (a language switch after the cache is warm),
Chromium and WebKit, in a Tokyo time zone with an en-GB system. 2/2
green.
Broken by hand: a cache key without the language is red in Chromium
(zh said "02/11/2026, 20:29:01" for "2026/11/2 20:29:01").
Run at this change on 74017e0b8 (mote): TestCoreScriptBudget ok. The
40 GUI files that say a reset time ("Resets", "Reset time",
"tomorrow", 重置) plus i18n-keys: 770 tests, 3 red. The reds are
codex-auto-reset webkit de 1100/420 (red the same at its base 40cfae5d3,
#4790) and i18n-keys 'a plugin's words are its own' (#5327#5332#5426#5482).
Not tried: the other ~37 toLocale*String calls in app.js. They run once
per page or row, not once per account window.