Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-13 16:37:25 +0300
committerJunio C Hamano <gitster@pobox.com>2018-11-13 16:37:26 +0300
commit11aa560de964e800aabce446d600ab0fb4c90c20 (patch)
tree3762ed62fab19d43f05030f44a9ec6edef978f25 /read-cache.c
parent409b3f287b63a4c911a6b3db6d31145a0fe981a1 (diff)
parent6c5b7f55a845bccf7b3abda92a78c621898d838d (diff)
Merge branch 'bp/refresh-index-using-preload'
The helper function to refresh the cached stat information in the in-core index has learned to perform the lstat() part of the operation in parallel on multi-core platforms. * bp/refresh-index-using-preload: refresh_index: remove unnecessary calls to preload_index() speed up refresh_index() by utilizing preload_index()
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index f3a848d61c..8c924506dd 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1496,6 +1496,12 @@ int refresh_index(struct index_state *istate, unsigned int flags,
typechange_fmt = (in_porcelain ? "T\t%s\n" : "%s needs update\n");
added_fmt = (in_porcelain ? "A\t%s\n" : "%s needs update\n");
unmerged_fmt = (in_porcelain ? "U\t%s\n" : "%s: needs merge\n");
+ /*
+ * Use the multi-threaded preload_index() to refresh most of the
+ * cache entries quickly then in the single threaded loop below,
+ * we only have to do the special cases that are left.
+ */
+ preload_index(istate, pathspec, 0);
for (i = 0; i < istate->cache_nr; i++) {
struct cache_entry *ce, *new_entry;
int cache_errno = 0;