jj/lib/src
Martin von Zweigbergk 86206e83a4 repo_path: avoid repeated copying of PathBuf in to_fs_path()
I've noticed `WorkspaceCommandHelper::format_file_path()` appear in
profiles a few times. A big part of that is spent in
`RepoPath::to_fs_path()`. I think I had been thinking that
`PathBuf::join()` takes `self` by value and mutates it, but it turns
out it creates a new instance. So our `result = result.join(...)` in a
loop was copying the `PathBuf` over and over. This fixes that and also
reserves the expected size. That speeds up `jj files
--ignore-working-copy -r v6.0` in the Linux repo from 546.0 s to 509.3
s (6.7%).
2023-09-09 08:43:29 -07:00
..
lock
protos
backend.rs
commit.rs
commit_builder.rs
conflicts.rs
content_hash.rs
dag_walk.rs
default_index_store.rs
default_revset_engine.rs
default_revset_graph_iterator.rs
default_submodule_store.rs
diff.rs
file_util.rs
files.rs
fmt_util.rs
fsmonitor.rs
git.rs
git_backend.rs
gitignore.rs
hex_util.rs
id_prefix.rs
index.rs
lib.rs
local_backend.rs
lock.rs
matchers.rs
merge.rs
merged_tree.rs
op_heads_store.rs
op_store.rs
operation.rs
refs.rs
repo.rs
repo_path.rs
revset.pest
revset.rs
revset_graph.rs
rewrite.rs
settings.rs
simple_op_heads_store.rs
simple_op_store.rs
stacked_table.rs
store.rs
submodule_store.rs
transaction.rs
tree.rs
tree_builder.rs
view.rs
working_copy.rs
workspace.rs