Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
7311dac
PERF-LIB: switching to a big view picks from a kept sort order instea…
nledford Oct 20, 2026
6b5d4c9
PERF-LIB: a small query sorts its own matches; an unchanged order is …
nledford Oct 20, 2026
366f69f
PERF-LIB: an edit moves its photo only in the orders that read what i…
nledford Oct 20, 2026
8d354e7
PERF-LIB: a small query drops a kept order whose changes are forgotte…
nledford Oct 20, 2026
dd4d178
PERF-LIB: a kept order is used as it is when no op came since, also i…
nledford Oct 20, 2026
8580dd4
PERF-LIB: a kept order follows added and removed photos when its chan…
nledford Oct 20, 2026
fe79dcf
PERF-LIB: the first sort of a big library in a view's sort is made on…
nledford Oct 20, 2026
56703be
PERF-LIB: the thread that makes a kept order holds an activity row wh…
nledford Oct 25, 2026
883323b
PERF-LIB: a big view asked for while its order is being made waits fo…
nledford Nov 5, 2026
e964c8a
PERF-LIB: a catalog on a platform with no threads stops preparing a k…
nledford Nov 6, 2026
2d92e87
PERF-LIB: Recently Added and an import's photos without a pass over t…
nledford Nov 7, 2026
96b0dfb
PERF-LIB: arrange_stacks asks about every photo of a view with a chea…
nledford Nov 7, 2026
b7de32f
PERF-LIB: format, clippy in the bench, What's New for Recently Added …
nledford Nov 7, 2026
05592af
PERF-LIB: mix photo ids fully for the stack hash, docs and comments m…
nledford Nov 7, 2026
d4b63dc
PERF-LIB: wording of the What's New line and a module comment (review…
nledford Nov 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/catalog/proptest-regressions/tests_order.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Seeds for failure cases proptest has generated in the past. It is
# automatically read and these particular cases re-run before any
# novel cases are generated.
#
# It is recommended to check this file in to source control so that
# everyone who runs the test benefits from these saved cases.
cc b51fced1f608fb7769423ce6f5303563c37beda7d2973d03e298b64b530cf6bc # shrinks to steps = [(2, 2, 1, 0)]
2 changes: 2 additions & 0 deletions crates/catalog/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub(crate) struct Indexes {
stacks: OnceLock<Option<HashMap<PhotoId, StackId>>>,
/// Album → its photos (regular albums; a smart album's list is empty).
albums: OnceLock<HashMap<AlbumId, HashSet<PhotoId>>>,
/// Every photo in each sort order, see [`crate::order`].
pub(crate) orders: crate::order::Orders,
}

/// A copy builds its own when asked (copies are made to be saved, not queried).
Expand Down
21 changes: 21 additions & 0 deletions crates/catalog/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub mod lock;
#[cfg(not(target_arch = "wasm32"))]
mod log_writer;
pub mod model;
mod order;
pub mod query;
pub mod rules;
pub mod safe_file;
Expand Down Expand Up @@ -719,6 +720,23 @@ impl Catalog {
ids.dedup();
Some(ids)
}

/// The photos whose `reads` (what a derived list reads of them) changed since the catalog was at `revision`,
/// added and removed photos included, each once, sorted by id. Ops that change no photo of their own (an
/// album, a stack, the keyword list) are not asked about. `None` when that is not known: too long ago, or the
/// catalog was set from outside (a library loaded).
pub(crate) fn photos_changed_since(&self, revision: u64, reads: Aspects) -> Option<Vec<PhotoId>> {
// (every op that changes a photo says which, in `photo_mut` or as it adds or removes it: the ops
// `apply_inner` marks broad change no photo)
if !(self.changes.seen == self.revision && revision <= self.revision && revision >= self.changes.floor) {
return None;
}
let mut ids: Vec<PhotoId> = self.changes.touched.iter().filter(|(r, _, a)| *r > revision && a.any_of(reads)).map(|(_, id, _)| *id).collect();
ids.sort_unstable();
ids.dedup();
Some(ids)
}

fn album_mut(&mut self, id: AlbumId) -> Result<&mut Album> {
self.albums.get_mut(&id).ok_or(CatalogError::NoAlbum(id))
}
Expand Down Expand Up @@ -1218,6 +1236,7 @@ impl Catalog {
/// wrote).
pub fn repair(&mut self) -> Vec<String> {
let mut changed = Vec::new();
self.index.orders.forget();
// Segmentation grids shared by the snapshot this was read from (issue #2154): each
// reference takes its grid's data, and the table is not kept — a live catalog always
// stores the data inline, so masks render and serialize without the snapshot's table.
Expand Down Expand Up @@ -1543,6 +1562,8 @@ mod tests_lock;
#[cfg(all(test, not(target_arch = "wasm32")))]
mod tests_log_thread;
#[cfg(test)]
mod tests_order;
#[cfg(test)]
mod tests_repair;
#[cfg(test)]
mod tests_rule_order;
Expand Down
Loading
Loading