Performance optimization and progress tracking at collection scale #48
Loading…
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?
Context
Every prior milestone has been built against a small development dataset. The real target
is a large family collection, and the access patterns that feel instant over a few hundred
photos behave differently over tens of thousands. This issue is the deliberate pass to
find out where.
Scope
Performance profiling and optimization across the read paths, plus progress tracking for
long-running operations.
Implementation notes
intuition on a dataset that fits in cache produces changes that help nothing.
pagination, near-duplicate candidate search, constraint recomputation across a large
album, and the audit log viewer.
decisions are loaded per photo in list views.
than full-resolution images in list views — this is likely the single largest browser-side win.
whether any long-running job holds a write lock long enough to block review actions.
duplicate scan, export, and integrity check.
rather than assertive.
Done when
References
docs/circa-spec.mdsection 13 (processing queue and performance)backend/app/repositories/,frontend/src/pages/PhotoBrowserAmended by the audit of 2026-07-28.
Two things pulled out of this issue and scheduled earlier, because they block usability rather
than optimize it:
browsing means reading filenames. Also a display-correctness matter:
image/tiffis accepted atingest and browsers cannot render TIFF in
<img>at all.indexes are actually used." Measured answer: the browse query does a full scan plus temp B-tree
at 61 ms over 50k rows, versus 0.14 ms with
(collection_id, created_at)— 436×.Also split out: media HTTP caching (#85), the event-loop-blocking ingest handler (#86), SQLite
pragmas for the worker (#87), cursor tiebreak (#88), and gzip (#92).
Measured and found not a problem, so removable from this issue's scope: N+1 queries. The
projection pattern is genuinely exploited — the list and detail endpoints read only projection
columns and no relationship access occurs during serialization. The production bundle is also
healthy at 89.5 KB gzip, single chunk; code-splitting is unnecessary at this size.