summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorBen Peart <benpeart@microsoft.com>2018-10-29 20:41:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-30 02:28:39 (GMT)
commit99ce720c338ebeb37331bd98f724569837c74d0d (patch)
treece7d8197078f0ab98d9e599d2ef46a167e35dd17 /cache.h
parentc670b1f876521c9f7cd40184bf7ed05aad843433 (diff)
downloadgit-99ce720c338ebeb37331bd98f724569837c74d0d.zip
git-99ce720c338ebeb37331bd98f724569837c74d0d.tar.gz
git-99ce720c338ebeb37331bd98f724569837c74d0d.tar.bz2
speed up refresh_index() by utilizing preload_index()
Speed up refresh_index() by utilizing preload_index() to do most of the work spread across multiple threads. This works because most cache entries will get marked CE_UPTODATE so that refresh_cache_ent() can bail out early when called from within refresh_index(). On a Windows repo with ~200K files, this drops refresh times from 6.64 seconds to 2.87 seconds for a savings of 57%. Signed-off-by: Ben Peart <benpeart@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index f7fabdd..883099d 100644
--- a/cache.h
+++ b/cache.h
@@ -659,6 +659,9 @@ extern int daemonize(void);
/* Initialize and use the cache information */
struct lock_file;
extern int read_index(struct index_state *);
+extern void preload_index(struct index_state *index,
+ const struct pathspec *pathspec,
+ unsigned int refresh_flags);
extern int read_index_preload(struct index_state *,
const struct pathspec *pathspec,
unsigned int refresh_flags);