Opening a list redraws the whole feed list and makes a date formatter for every row #490

Closed
opened 2026-11-22 08:26:03 -08:00 by rays · 1 comment
Owner

A CPU profile of the page opening four lists twice (All Subscriptions, a Signal, two podcasts), on production's data at an iPhone 13's size with the CPU slowed 4x, had two costs that do nothing for the list:

  • selectFeed called renderFeeds(), rebuilding every row of the feed list, folders and art included, only to move the highlight: about 300 ms of the run.
  • dateOf called toLocaleDateString with options, which makes a new Intl.DateTimeFormat on every call, once a row: about 155 ms.

Out of 2.3-2.5 s of CPU time in the run. In production list_shown is 145 ms at the median and 780 ms at p95, with the slowest (1.1-2.9 s on the phone) spending 4-45 ms in ipx; the rest is the network and the phone drawing. Found by a speed check.

A CPU profile of the page opening four lists twice (All Subscriptions, a Signal, two podcasts), on production's data at an iPhone 13's size with the CPU slowed 4x, had two costs that do nothing for the list: * `selectFeed` called `renderFeeds()`, rebuilding every row of the feed list, folders and art included, only to move the highlight: about 300 ms of the run. * `dateOf` called `toLocaleDateString` with options, which makes a new `Intl.DateTimeFormat` on every call, once a row: about 155 ms. Out of 2.3-2.5 s of CPU time in the run. In production `list_shown` is 145 ms at the median and 780 ms at p95, with the slowest (1.1-2.9 s on the phone) spending 4-45 ms in ipx; the rest is the network and the phone drawing. Found by a speed check.
rays added the bug label 2026-11-22 08:26:03 -08:00
Author
Owner

Fixed in f633f3d, deployed in ipx-web: selecting a feed moves .sel and aria-current (markSelected) instead of rebuilding the feed list, and dateOf uses one shared Intl.DateTimeFormat. The same profile run: CPU time 2.3-2.5 s down to 1.25-1.65 s; dateOf 157 ms to 12 ms; renderFeeds ~310 ms to 70-130 ms (what is left is the first draw and live updates). Browser suite: 127 passed.

Fixed in f633f3d, deployed in ipx-web: selecting a feed moves `.sel` and `aria-current` (markSelected) instead of rebuilding the feed list, and dateOf uses one shared Intl.DateTimeFormat. The same profile run: CPU time 2.3-2.5 s down to 1.25-1.65 s; dateOf 157 ms to 12 ms; renderFeeds ~310 ms to 70-130 ms (what is left is the first draw and live updates). Browser suite: 127 passed.
rays closed this issue 2026-11-22 08:26:47 -08:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#490