diff options
author | David Turner <dturner@twopensource.com> | 2015-12-21 17:34:20 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-01-05 13:39:46 -0800 |
commit | d9c2bd560e1e7a3d4654fb6ef3f9037ad337eb01 (patch) | |
tree | 04df29e0820e079bf4c90570b6e1adf39af5a1ac /tree-walk.h | |
parent | f3adf457e046f92f039353762a78dcb3afb2cb13 (diff) | |
download | git-d9c2bd560e1e7a3d4654fb6ef3f9037ad337eb01.tar.gz |
do_compare_entry: use already-computed path
In traverse_trees, we generate the complete traverse path for a
traverse_info. Later, in do_compare_entry, we used to go do a bunch
of work to compare the traverse_info to a cache_entry's name without
computing that path. But since we already have that path, we don't
need to do all that work. Instead, we can just put the generated
path into the traverse_info, and do the comparison more directly.
We copy the path because prune_traversal might mutate `base`. This
doesn't happen in any codepaths where do_compare_entry is called,
but it's better to be safe.
This makes git checkout much faster -- about 25% on Twitter's
monorepo. Deeper directory trees are likely to benefit more than
shallower ones.
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-walk.h')
-rw-r--r-- | tree-walk.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tree-walk.h b/tree-walk.h index 3b2f7bf17d..174eb617df 100644 --- a/tree-walk.h +++ b/tree-walk.h @@ -59,6 +59,7 @@ enum follow_symlinks_result { enum follow_symlinks_result get_tree_entry_follow_symlinks(unsigned char *tree_sha1, const char *name, unsigned char *result, struct strbuf *result_path, unsigned *mode); struct traverse_info { + const char *traverse_path; struct traverse_info *prev; struct name_entry name; int pathlen; |