Files
lightcraft/docs
Nathaniel LedfordandClaude Opus 5.5 43ba500c6e PERF-EDIT: a smart album's count follows an edit, asking only the photos it touched
The left panel shows a count beside every album. Each catalog revision had
every album counted again, and a smart album's count asks every photo of
the library whether its rules hold: one pass over the library for each smart
album after each keyword, rating or slider tick (about 25 ms an album in a
library of 67,000 photos).

`AlbumTally` (`crates/catalog/src/tally.rs`) keeps the counts and, for each
smart album, which photos it holds. After a small edit each smart album asks
only the photos the edit touched (`Catalog::touched_since`); an album of
chosen photos is counted again only when a photo came, went or was deleted.
Counted from every photo as before: new rules, a change to an album, a stack
or the keyword list, an edit to more than 256 photos, another library, and
each new minute while an album asks about "the last N days".

What an album remembers is in proportion to the photos it holds: a bit a
photo id while ids are close together, a set when they are far apart.

The frame after a keyword in that library, both side panels open: about
54 ms -> 27 ms (156 ms before #1660).

Tests: 900 random edits against eight smart albums (keywords, flags,
ratings, labels, sliders, capture dates, file names, an album of chosen
photos) and an ordinary one, the followed counts compared with
`album_count` after each; a delete followed, three hundred photos counted
whole; the members' bits at the edges and for ids far apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 07:46:42 -04:00
..
2026-10-13 11:05:53 +07:00
2026-10-13 11:02:58 +07:00
2026-10-13 11:05:47 +07:00
2026-10-14 01:27:32 -04:00
2026-10-13 02:05:14 -04:00
2026-10-13 11:01:54 +07:00
2026-10-08 20:20:17 +00:00
2026-10-09 20:56:56 -04:00
2026-10-14 01:40:32 -04:00
2026-10-11 12:03:53 +00:00
2026-10-14 01:54:50 -04:00
2026-10-14 01:29:30 -04:00
2026-10-11 12:40:55 +00:00
2026-10-13 11:01:49 +07:00