Tabs: bound thumbnail requests on Files and Photos #1377

Open
opened 2026-10-07 15:03:06 +00:00 by kayg · 0 comments
Owner

Found in the production Tab-switching storm for #1338. Related: #1338 and #1233.

The request budget allows at most one in-flight request per visible Tab. The storm exceeded it on both image-heavy Tabs. Across the three storms, the selected Files view started 735/1,073 requests (CPU4/no throttle), with max in-flight 25 in both conditions. The selected Photos view started 1,373/1,044 requests, with max in-flight 20/25. The CPU4 trace captured 24 browser Image requests to /api/v1/files/thumb/:hash during its 15.8-second diagnostic window. Those 24 had completed by the end of that trace, so this evidence confirms the concurrency burst, not an image request stuck indefinitely.

The request sources are direct browser image elements: FileThumb in packages/ui/src/components/files/FileThumb.svelte (used by FileCollection.svelte) and the tile <img> in apps/web/src/lib/photos/PhotoTimeline.svelte (built with thumbUrl() from apps/web/src/lib/photos/api.ts). These image requests have no AbortSignal; inspect whether they should stop when their owning Tab leaves and choose a bounded preview concurrency that still fills the visible window.

The per-Tab measurement includes API calls, images and other subresources. Keep those categories separate in any fix/profile follow-up so the one-request ceiling does not hide useful thumbnail work or the difference between visible loads and requests from a departed Tab.

Trace: artifacts/tabstorm-1338/cpu4-budget-failure-trace.json. The raw storm rows and per-Tab totals are in docs/perf/runs/2026-10-07-1338-tabstorm* on the job branch.

Found in the production Tab-switching storm for #1338. Related: #1338 and #1233. The request budget allows at most one in-flight request per visible Tab. The storm exceeded it on both image-heavy Tabs. Across the three storms, the selected Files view started 735/1,073 requests (CPU4/no throttle), with max in-flight 25 in both conditions. The selected Photos view started 1,373/1,044 requests, with max in-flight 20/25. The CPU4 trace captured 24 browser `Image` requests to `/api/v1/files/thumb/:hash` during its 15.8-second diagnostic window. Those 24 had completed by the end of that trace, so this evidence confirms the concurrency burst, not an image request stuck indefinitely. The request sources are direct browser image elements: `FileThumb` in `packages/ui/src/components/files/FileThumb.svelte` (used by `FileCollection.svelte`) and the tile `<img>` in `apps/web/src/lib/photos/PhotoTimeline.svelte` (built with `thumbUrl()` from `apps/web/src/lib/photos/api.ts`). These image requests have no `AbortSignal`; inspect whether they should stop when their owning Tab leaves and choose a bounded preview concurrency that still fills the visible window. The per-Tab measurement includes API calls, images and other subresources. Keep those categories separate in any fix/profile follow-up so the one-request ceiling does not hide useful thumbnail work or the difference between visible loads and requests from a departed Tab. Trace: `artifacts/tabstorm-1338/cpu4-budget-failure-trace.json`. The raw storm rows and per-Tab totals are in `docs/perf/runs/2026-10-07-1338-tabstorm*` on the job branch.
Commenting is not possible because the repository is archived.
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal-v0#1377
No description provided.