[Bug]: Image Viewer is very slow with directories over 1,000 images #46

Closed
opened 2026-06-12 04:40:33 +00:00 by ValleyGeek · 3 comments
Owner

App version

0.1.21

Platform

Both

Steps to reproduce

  1. Open a directory with 1,000+ images
  2. Double click an image in the grid
  3. Navigate forward or back by an image

Expected behavior

Near instant movement between images

Actual behavior

a nearly three second delay between double click and viewer opening then another three second delay between each image change on navigation forward or back.

Additional context

  • Test computer is nearly idle while using the application.
  • On a directory of 2,500 images the application is using 1,733 mb RAM, during image navigate the RAM spikes to 2,300 mb during the switch operation then drops back to the starting amount once the image changes.
### App version 0.1.21 ### Platform Both ### Steps to reproduce 1. Open a directory with 1,000+ images 2. Double click an image in the grid 3. Navigate forward or back by an image ### Expected behavior Near instant movement between images ### Actual behavior a nearly three second delay between double click and viewer opening then another three second delay between each image change on navigation forward or back. ### Additional context - Test computer is nearly idle while using the application. - On a directory of 2,500 images the application is using 1,733 mb RAM, during image navigate the RAM spikes to 2,300 mb during the switch operation then drops back to the starting amount once the image changes.
Member

Implemented a fix on branch 0.1.21/issue-46-viewer-perf.

Root cause: _refresh_filmstrip() decoded thumbnails for every image in the filtered session (e.g. 2,500) on each viewer open and on every A/D navigation, even though the filmstrip only paints a small visible window.

Fix: The filmstrip now binds a lazy session with per-index resolvers. Navigation updates only the active index; thumbnails are resolved at paint time for visible slots only. Carousel neighbors still resolve individually (2 lookups), not the full session.

Verification: Added regression test test_viewer_navigation_does_not_resolve_all_filmstrip_thumbs; all PR8 viewer tests pass.

Implemented a fix on branch `0.1.21/issue-46-viewer-perf`. **Root cause:** `_refresh_filmstrip()` decoded thumbnails for every image in the filtered session (e.g. 2,500) on each viewer open and on every A/D navigation, even though the filmstrip only paints a small visible window. **Fix:** The filmstrip now binds a lazy session with per-index resolvers. Navigation updates only the active index; thumbnails are resolved at paint time for visible slots only. Carousel neighbors still resolve individually (2 lookups), not the full session. **Verification:** Added regression test `test_viewer_navigation_does_not_resolve_all_filmstrip_thumbs`; all PR8 viewer tests pass.
Member

Follow-up on branch 0.1.21/issue-46-viewer-perf: optimized viewer exit → grid return.

  • Added lightweight _exit_viewer_to_workbench() fast path (avoids full _activate_workbench re-activation and redundant filter re-application)
  • ImageFilterProxy setters now no-op when unchanged; added begin_batch_update / end_batch_update to coalesce invalidations
  • Viewer display cache cleared on exit via clear_session_resources()
  • Grid/trash workbench activation batches filter changes and skips duplicate invalidation in _refresh_tag_filter_views

Regression tests added for filter batching/no-op guards, single invalidate on viewer restore, and display cache clearing. Full pytest suite passes.

Follow-up on branch `0.1.21/issue-46-viewer-perf`: optimized viewer exit → grid return. - Added lightweight `_exit_viewer_to_workbench()` fast path (avoids full `_activate_workbench` re-activation and redundant filter re-application) - `ImageFilterProxy` setters now no-op when unchanged; added `begin_batch_update` / `end_batch_update` to coalesce invalidations - Viewer display cache cleared on exit via `clear_session_resources()` - Grid/trash workbench activation batches filter changes and skips duplicate invalidation in `_refresh_tag_filter_views` Regression tests added for filter batching/no-op guards, single invalidate on viewer restore, and display cache clearing. Full pytest suite passes.
Grok closed this issue 2026-06-12 06:14:18 +00:00
Member

Resolved in PR for branch 0.1.21/issue-46-viewer-perf (release 0.1.22).

Delivered:

  • Lazy filmstrip loading (visible window only) — near-instant A/D navigation in 1k+ image sessions
  • Fast-path viewer exit with batched/coalesced filter invalidations
  • Viewer display cache released on return to grid

Closing as fixed.

Resolved in PR for branch `0.1.21/issue-46-viewer-perf` (release **0.1.22**). **Delivered:** - Lazy filmstrip loading (visible window only) — near-instant A/D navigation in 1k+ image sessions - Fast-path viewer exit with batched/coalesced filter invalidations - Viewer display cache released on return to grid Closing as fixed.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
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
ai-collab/bulk-image-organizer#46
No description provided.