ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/lib/tests
Yuya Nishihara 12d7f8be16 repo_path: turn RepoPath into String wrapper
RepoPath::from_components() is removed since it is no longer a primitive
function.

The components iterator could be implemented on top of str::split(), but
it's not as we'll probably want to add components.as_path() -> &RepoPath.

Tree walking and tree_states map construction get slightly faster thanks to
fewer allocations and/or better cache locality. If we add a borrowed RepoPath
type, we can also implement a cheap &str to &RepoPath conversion on top. Then,
we can get rid of BTreeMap<RepoPath, FileState> construction at all.

Snapshot without watchman:
```
% hyperfine --sort command --warmup 3 --runs 10 -L bin jj-0,jj-1 \
"target/release-with-debug/{bin} -R ~/mirrors/linux status"
Benchmark 1: target/release-with-debug/jj-0 -R ~/mirrors/linux status
  Time (mean ± σ):     950.1 ms ±  24.9 ms    [User: 1642.4 ms, System: 681.1 ms]
  Range (min … max):   913.8 ms … 990.9 ms    10 runs

Benchmark 2: target/release-with-debug/jj-1 -R ~/mirrors/linux status
  Time (mean ± σ):     872.1 ms ±  14.5 ms    [User: 1922.3 ms, System: 625.8 ms]
  Range (min … max):   853.2 ms … 895.9 ms    10 runs

Relative speed comparison
        1.09 ±  0.03  target/release-with-debug/jj-0 -R ~/mirrors/linux status
        1.00          target/release-with-debug/jj-1 -R ~/mirrors/linux status
```

Tree walk:
```
% hyperfine --sort command --warmup 3 --runs 10 -L bin jj-0,jj-1 \
"target/release-with-debug/{bin} -R ~/mirrors/linux files --ignore-working-copy"
Benchmark 1: target/release-with-debug/jj-0 -R ~/mirrors/linux files --ignore-working-copy
  Time (mean ± σ):     375.3 ms ±  15.4 ms    [User: 223.3 ms, System: 151.8 ms]
  Range (min … max):   359.4 ms … 394.1 ms    10 runs

Benchmark 2: target/release-with-debug/jj-1 -R ~/mirrors/linux files --ignore-working-copy
  Time (mean ± σ):     357.1 ms ±  16.2 ms    [User: 214.7 ms, System: 142.6 ms]
  Range (min … max):   341.6 ms … 378.9 ms    10 runs

Relative speed comparison
        1.05 ±  0.06  target/release-with-debug/jj-0 -R ~/mirrors/linux files --ignore-working-copy
        1.00          target/release-with-debug/jj-1 -R ~/mirrors/linux files --ignore-working-copy
```
2023-11-27 08:42:09 +09:00
..
test_bad_locking.rs workspace: load working copy implementation dynamically 2023-10-16 22:33:44 -07:00
test_commit_builder.rs merged_tree: propagate backend errors in diff iterator 2023-10-26 06:20:56 -07:00
test_commit_concurrent.rs testutils: delete bool-typed init() in favor of enum-typed version 2023-09-18 07:15:37 -07:00
test_conflicts.rs merge: rename Merge::new() to Merge::from_removes_adds() 2023-11-07 17:10:12 +09:00
test_default_revset_graph_iterator.rs test: use test backend in most remaining tests too 2023-09-24 21:24:01 -07:00
test_diff_summary.rs merged_tree: propagate backend errors in diff iterator 2023-10-26 06:20:56 -07:00
test_git.rs tests: add upper bound to test_concurrent_read_write_commit() loop 2023-11-24 18:07:35 +09:00
test_id_prefix.rs testutils: delete bool-typed init() in favor of enum-typed version 2023-09-18 07:15:37 -07:00
test_index.rs test: use test backend in most remaining tests too 2023-09-24 21:24:01 -07:00
test_init.rs workspace: add function that initializes colocated git repository 2023-11-05 08:48:35 +09:00
test_load_repo.rs test: use test backend in most remaining tests too 2023-09-24 21:24:01 -07:00
test_local_working_copy.rs repo_path: split RepoPathComponent into owned and borrowed types 2023-11-26 18:21:40 +09:00
test_local_working_copy_concurrent.rs workspace: load working copy implementation dynamically 2023-10-16 22:33:44 -07:00
test_local_working_copy_sparse.rs working copy: pass commit instead of tree into check_out() 2023-10-16 22:33:44 -07:00
test_merge_trees.rs repo_path: turn RepoPath into String wrapper 2023-11-27 08:42:09 +09:00
test_merged_tree.rs repo_path: make RepoPath::components() return iterator 2023-11-27 08:42:09 +09:00
test_mut_repo.rs view: add tracking state to RemoteRef 2023-10-16 23:21:05 +09:00
test_operations.rs tests: test views, operations, and mutable repos only with test backend 2023-09-20 07:47:30 -07:00
test_refs.rs merge: add Merge constructor that accepts interleaved values 2023-11-07 17:10:12 +09:00
test_revset.rs revset: add a RevsetExpression::evaluate_programmatic() 2023-11-24 21:13:58 -10:00
test_rewrite.rs rewrite: fix check for newly-empty commit in optimized path 2023-11-26 14:42:17 +09:00
test_view.rs refs: merge tracking state of remote branches 2023-10-24 07:13:58 +09:00
test_workspace.rs workspace: make working-copy type customizable 2023-10-16 22:33:44 -07:00