From 6174fd28c4c7311aafdf5ea22427c80725faafac Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 2 Nov 2026 11:20:30 +0100 Subject: remake: read ops, not diffs This gives bench_replay a speedup of ~8x/64x/280x. --- src/remake/bench.rs | 3 ++- src/remake/delta.rs | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/remake/bench.rs b/src/remake/bench.rs index 3c3f513..f262601 100644 --- a/src/remake/bench.rs +++ b/src/remake/bench.rs @@ -3,7 +3,8 @@ //! `replay`: carrying writes over into a new epoch's document, last writer wins //! (`delta::replay_newest`): what a rejoin does with the writes made during it, and a //! switch with those made after the remake's base. It finds the paths of every write -//! carried, and of every newer change in the new document, by a diff each. +//! carried, and of every newer change in the new document, from its operations +//! (`store::changed_by`). use std::time::Instant; diff --git a/src/remake/delta.rs b/src/remake/delta.rs index 2c6c93d..638231c 100644 --- a/src/remake/delta.rs +++ b/src/remake/delta.rs @@ -163,16 +163,15 @@ fn between(doc: &Document, before: &[ChangeHash], after: &[ChangeHash]) -> Vec Vec<(i64, Vec>)> { changes .iter() .filter_map(|hash| { let change = doc.get_change_by_hash(hash)?; - let paths = store::changed(doc, change.deps(), &[*hash], InLists::Whole) - .into_iter() - .map(|changed| changed.path) - .collect(); + let paths = store::changed_by(doc, hash, InLists::Whole)?; Some((change.timestamp(), paths)) }) .collect() -- cgit v1.3.1