Diff renders only the edited files and skips freeing at exit (refs #41) 10b4fd430eab
State::materialize_nodes renders the text files of the given nodes
without building a set of every other file to leave out, used for a
change's base; oxy diff forgets its structures as the process ends.
Phases for the base rendering and the diff rendering. On the Linux tree,
one file edited: 0.19 to 0.21 s (from 0.25 s; Git 0.08 s).
- **Status twice as fast as Git on the Linux tree (#41).** With uncommitted work, `oxy status` answers from a status cache while every file is as the last snapshot left it, and the manifest keeps every directory's time, so the tree is listed only when a directory's entries changed. One edited file is 0.10 to 0.12 s (from 0.44 s; Git 0.22 s) and a clean status 0.09 to 0.12 s (Git 0.20 to 0.26 s), in 80 MB. `oxy diff` renders the working copy from the cache too (0.25 s, from 0.41 s). A file written within the racy window is now hashed by the prompt's check too, as it was by status.
5
+
- **Status twice as fast as Git on the Linux tree (#41).** With uncommitted work, `oxy status` answers from a status cache while every file is as the last snapshot left it, and the manifest keeps every directory's time, so the tree is listed only when a directory's entries changed. One edited file is 0.10 to 0.12 s (from 0.44 s; Git 0.22 s) and a clean status 0.09 to 0.12 s (Git 0.20 to 0.26 s), in 80 MB. `oxy diff` renders the working copy from the cache too (0.20 s, from 0.41 s; Git 0.08 s). A file written within the racy window is now hashed by the prompt's check too, as it was by status.
6
6
7
7
- **Quieter notes (#55).** Notes start with a dimmed `›` instead of `ℹ`, which many terminal fonts draw as a boxed or emoji-style "i". A spinner's final line no longer shows two ticks or runs into the next line.
8
8
…
53 unchanged lines
modifiedcrates/oxy-core/src/repo/mod.rs+5−9
…
1969 unchanged lines
1970
1970
change: &Change,
1971
1971
mut base: State,
1972
1972
) -> Result<(State, Snapshot)> {
1973
+
let _t = crate::timing::phase("diff: render the base");
1973
1974
let edited: std::collections::HashSet<NodeId> =
1974
1975
change.edits.iter().map(|e| e.node()).collect();
1975
1976
let nodes: Vec<NodeId> = edited.iter().copied().collect();
1976
1977
self.load_graphs_of(&mut base, &nodes)?;
1977
-
let skip: std::collections::HashSet<NodeId> = base