ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/lib/tests
Yuya Nishihara a935a4f70c working_copy: use proto file states without rebuilding BTreeMap
In snapshot(), changed_file_states are received in arbitrary order. For the
other callers, entries are in diff_stream order, so we don't have to sort
them.

With watchman enabled, we can see the cost of sorting the sorted proto entries.
I don't think this is significant, but we can mitigate it by adding
is_file_states_sorted flag to the proto message if needed:
```
% hyperfine --sort command --warmup 3 --runs 20 -L bin jj-0,jj-1 \
"target/release-with-debug/{bin} -R ~/mirrors/linux files ~/mirrors/linux/no-match"
Benchmark 1: target/release-with-debug/jj-0 -R ~/mirrors/linux files ~/mirrors/linux/no-match
  Time (mean ± σ):     164.8 ms ±  16.6 ms    [User: 50.2 ms, System: 111.7 ms]
  Range (min … max):   148.1 ms … 195.0 ms    20 runs

Benchmark 2: target/release-with-debug/jj-1 -R ~/mirrors/linux files ~/mirrors/linux/no-match
  Time (mean ± σ):     171.8 ms ±  13.6 ms    [User: 61.7 ms, System: 109.0 ms]
  Range (min … max):   159.5 ms … 192.1 ms    20 runs
```

Without watchman:
```
% hyperfine --sort command --warmup 3 --runs 20 -L bin jj-0,jj-1 \
"target/release-with-debug/{bin} -R ~/mirrors/linux files ~/mirrors/linux/no-match"
Benchmark 1: target/release-with-debug/jj-0 -R ~/mirrors/linux files ~/mirrors/linux/no-match
  Time (mean ± σ):     367.3 ms ±  30.3 ms    [User: 1415.2 ms, System: 633.8 ms]
  Range (min … max):   325.4 ms … 421.7 ms    20 runs

Benchmark 2: target/release-with-debug/jj-1 -R ~/mirrors/linux files ~/mirrors/linux/no-match
  Time (mean ± σ):     327.7 ms ±  24.9 ms    [User: 1059.1 ms, System: 654.3 ms]
  Range (min … max):   296.0 ms … 385.4 ms    20 runs
```

I haven't measured snapshotting against dirty working copy, but I don't think
it would be slower than the original implementation.
2023-11-30 12:09:31 +09:00
..
test_bad_locking.rs
test_commit_builder.rs repo_path: split RepoPath into owned and borrowed types 2023-11-28 07:33:28 +09:00
test_commit_concurrent.rs
test_conflicts.rs repo_path: split RepoPath into owned and borrowed types 2023-11-28 07:33:28 +09:00
test_default_revset_graph_iterator.rs
test_diff_summary.rs repo_path: split RepoPath into owned and borrowed types 2023-11-28 07:33:28 +09:00
test_git.rs
test_id_prefix.rs
test_index.rs
test_init.rs
test_load_repo.rs
test_local_working_copy.rs working_copy: use proto file states without rebuilding BTreeMap 2023-11-30 12:09:31 +09:00
test_local_working_copy_concurrent.rs repo_path: split RepoPath into owned and borrowed types 2023-11-28 07:33:28 +09:00
test_local_working_copy_sparse.rs working_copy: use proto file states without rebuilding BTreeMap 2023-11-30 12:09:31 +09:00
test_merge_trees.rs repo_path: split RepoPath into owned and borrowed types 2023-11-28 07:33:28 +09:00
test_merged_tree.rs repo_path: split RepoPath into owned and borrowed types 2023-11-28 07:33:28 +09:00
test_mut_repo.rs
test_operations.rs
test_refs.rs
test_revset.rs repo_path: split RepoPath into owned and borrowed types 2023-11-28 07:33:28 +09:00
test_rewrite.rs repo_path: split RepoPath into owned and borrowed types 2023-11-28 07:33:28 +09:00
test_view.rs
test_workspace.rs