mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-27 06:27:43 +00:00
index: make revision walk be by position instead of generation number
I don't know why I made it walk by generation number to start with. Walking by position is better in at least two ways: 1) revsets now depend on the walks to be by descending index position (though they could equally well depend on the walks to be by generation number -- it just needs to be consistent), and 2) the log output gets less interleaved. This commit makes the number of bytes in the graphlog output in the git.git repo drop by ~40% due to the reduced amount of interleaving. Also, it reduces the time of `jj bench walkrevs v1.0.0 v2.0.0` in the git.git repo by 32% (9.4ms -> 6.4ms) and `jj bench walkrevs v2.0.0 v1.0.0` by 33% (7.7ms -> 5.1ms).
This commit is contained in:
parent
98f4e24892
commit
6bc1361b84
1 changed files with 3 additions and 3 deletions
|
@ -1009,7 +1009,7 @@ impl PartialOrd for IndexEntryByGeneration<'_> {
|
||||||
|
|
||||||
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd)]
|
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd)]
|
||||||
struct RevWalkWorkItem<'a> {
|
struct RevWalkWorkItem<'a> {
|
||||||
entry: IndexEntryByGeneration<'a>,
|
entry: IndexEntryByPosition<'a>,
|
||||||
wanted: bool,
|
wanted: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1036,7 +1036,7 @@ impl<'a> RevWalk<'a> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.items.push(RevWalkWorkItem {
|
self.items.push(RevWalkWorkItem {
|
||||||
entry: IndexEntryByGeneration(self.index.entry_by_pos(pos)),
|
entry: IndexEntryByPosition(self.index.entry_by_pos(pos)),
|
||||||
wanted: true,
|
wanted: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1046,7 +1046,7 @@ impl<'a> RevWalk<'a> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.items.push(RevWalkWorkItem {
|
self.items.push(RevWalkWorkItem {
|
||||||
entry: IndexEntryByGeneration(self.index.entry_by_pos(pos)),
|
entry: IndexEntryByPosition(self.index.entry_by_pos(pos)),
|
||||||
wanted: false,
|
wanted: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue