aboutsummaryrefslogtreecommitdiffstats
path: root/src/remake
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-02 11:20:30 +0100
committertv <tv@krebsco.de>2026-11-02 11:22:04 +0100
commit6174fd28c4c7311aafdf5ea22427c80725faafac (patch)
treecd9b97b1bc8c61146e28b4af43365f7e66f29fa5 /src/remake
parentd5e9416ff9ec06e22aba4f69b1a29c5a7b729a2c (diff)
remake: read ops, not diffs
This gives bench_replay a speedup of ~8x/64x/280x.
Diffstat (limited to 'src/remake')
-rw-r--r--src/remake/bench.rs3
-rw-r--r--src/remake/delta.rs9
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<C
found.into_iter().collect()
}
-/// For each of `changes` (in `doc`), its time and the store paths it touched.
+/// For each of `changes` (in `doc`), its time and the store paths it touched, from its
+/// operations (`store::changed_by`: a diff per change would cost what the maps it
+/// touched hold, `remake::bench`).
fn touched(doc: &Document, changes: &[ChangeHash]) -> Vec<(i64, Vec<Vec<String>>)> {
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()