Skip to content

fix(thumbnails): report per-frame read time and time left during Update Thumbnails - #6

Closed
thetalkingdrum wants to merge 2 commits into
mainfrom
claude/great-feynman-7tke63
Closed

thetalkingdrum wants to merge 2 commits into
mainfrom
claude/great-feynman-7tke63

Conversation

@thetalkingdrum

@thetalkingdrum thetalkingdrum commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Part of marcinz606#1232. A roll-scope Update Thumbnails on a slow SMB share took ~15 min for 49 ARWs at ~3% CPU. Each frame is one 15–20 s network read plus ~1 s of decode/render, and the status bar showed no timing, so the refresh looked hung.

Changes

  • Worker (ThumbnailRenderWorker.process): times _decode_asset_preview_with_meta and run_pipeline separately with time.perf_counter(). progress is now (done, total, name, decode_s, render_s). A frame that fails reports the time the failed step took, so unreadable files on a slow share still count toward the estimate; a step that never ran reports 0.0.
  • frame_started(index, total, name): emitted before each decode, so the first frame's read isn't silent.
  • Controller: keeps a per-generation running mean (reset when refresh_thumbnails_for starts a generation; a pre-emption resume starts a new one). Formatting lives in the pure thumbnail_refresh_status(...):
    • time left (— ~N min left / — ~N s left) from done >= 2;
    • (reading source files, N s/frame) when mean decode > 3 s and > 2× mean render;
    • otherwise the existing text, unchanged.
    • frame_started uses the same function with in_flight=True: the frame being decoded counts as left, and only finished frames count as samples.
  • Tooltip / User Guide: the fingerprint branch hasn't merged, so both setToolTip sites and docs/USER_GUIDE.md now say the roll refresh does every thumbnail, not "every stale" one.

Out of scope: stale-only refresh and render fingerprints (feat/thumbnail-fingerprint). Which frames the roll scope dispatches is unchanged.

Tests

  • Worker: a scripted perf_counter checks the decode/render durations in the payload; frame_started fires before each decode; a failed decode and a failed render each report the time they took.
  • thumbnail_refresh_status: no ETA at done=1 or on the last frame; seconds vs minutes; the read-bound hint only when decode dominates.
  • Controller: the running mean resets on a new generation; frame_started shows the in-flight frame with time left.
  • Updated the existing 3-arg progress connection.

make all: lint and type clean, 7327 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W1MEH5L17tDmpmz1H47dap

…te Thumbnails

A roll-scope refresh on a slow SMB share (marcinz606#1232: 49 ARWs,
~15 min at ~3% CPU) spent almost all its time on 15-20 s network reads and
showed only "Updating N thumbnails..." for the first frame, so it looked hung.

- ThumbnailRenderWorker times the decode and the pipeline separately and
  carries both on `progress(done, total, name, decode_s, render_s)`; a failed
  or skipped frame reports what it measured, or 0.0.
- New `frame_started(index, total, name)` fires before each decode.
- The controller keeps a per-generation running mean and formats the status
  through `thumbnail_refresh_status`: time left from the second frame on, and
  "(reading source files, N s/frame)" when decode dominates and exceeds 3 s.
- Update Thumbnails tooltip and User Guide no longer claim a stale-only
  roll refresh; the roll scope re-renders every thumbnail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W1MEH5L17tDmpmz1H47dap
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Preview load metrics (github-linux-x64)

format cold load throughput
CR2 0.508 s 44.12 MPx/s
NEF 0.385 s 63.87 MPx/s
ARW 0.133 s 151.98 MPx/s
RAF 1.334 s 12.19 MPx/s
DNG 0.414 s 57.84 MPx/s

fixtures: rawsamples.ch · sha: 8ead9bc · full JSON

@thetalkingdrum
thetalkingdrum marked this pull request as draft September 30, 2026 19:44
A frame whose decode or render raised reported 0 s, so on a slow share a
roll with many unreadable files showed too little time left and could hide
the read-bound hint. The worker now reports the time the failed step took.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W1MEH5L17tDmpmz1H47dap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants