[Bug]: Duplicates Workbench Loads Slowly with 2,000+ Duplicate Groups #94
Labels
No labels
Kind/Bug
Kind/Feature
Priority/High
Priority/Medium
Reviewed/Confirmed
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ai-collab/bulk-image-organizer#94
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
App version
0.1.31
Platform
Both
Steps to reproduce
Expected behavior
UI updates immediately and duplicate list is populated as it is loaded
Actual behavior
Program freezes for a few seconds then the UI refreshes
Additional context
No response
Implemented on branch
0.1.33/issue-94-dupe-workbench-slow-load(commitc1f047d).Root cause:
DupeContainer._rebuild_tag_list()(the Duplicates workbench's dupe-tag sidebar) synchronously created one widget row perF-DUPE_/V-DUPE_tag in a single main-thread pass. Profiling confirmed the DB query itself is fast (~20ms for 2,000 tags viaget_dupe_tag_summaries) — the freeze is entirely from widget construction (~2-3s for 2,000 rows once layout/style passes are accounted for).Fix: row widgets are now built in small batches (40 per tick) across event-loop ticks via a
QTimerparented to the panel, guarded by a rebuild-generation token so a newer refresh cleanly supersedes an in-flight batch instead of corrupting it.visible_tag_names()now reflects the full filtered tag list immediately (used for auto-selecting/navigating groups), independent of how many row widgets have been built so far — so existing keyboard navigation and "select first group" behavior is unaffected even while rows are still populating.With 2,000 synthetic groups, worst-case single-tick block dropped from a multi-second freeze to ~30-50ms (imperceptible), with the list visibly populating in the sidebar instead of the UI hanging.
Added regression tests (
tests/test_pr11_dupe.py) covering batched population and stale-rebuild cancellation. Full suite (346 tests) andruff check/formatare clean; ran the full suite 5x to confirm no flakiness.Not opening a PR yet per project workflow — will do so on request.
Status: partially resolved — fix is up for review in PR #100 (
0.1.33/issue-94-dupe-workbench-slow-load→main).What changed:
Net effect: the freeze described in this issue is significantly reduced, and the list now populates progressively as requested. Leaving this open (not closing) until the PR merges, in case further edge cases surface during review.
[Bug]: Duplicates Workbends Loads Slowly with 2,000+ Duplicate Groupsto [Bug]: Duplicates Workbench Loads Slowly with 2,000+ Duplicate Groups