From 671c9b7e315db89081cc69f83a8f405e4aca37bc Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 13 Nov 2008 16:36:30 -0800 Subject: Add cache preload facility This can do the lstat() storm in parallel, giving potentially much improved performance for cold-cache cases or things like NFS that have weak metadata caching. Just use "read_cache_preload()" instead of "read_cache()" to force an optimistic preload of the index stat data. The function takes a pathspec as its argument, allowing us to preload only the relevant portion of the index. Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- builtin-diff-files.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin-diff-files.c') diff --git a/builtin-diff-files.c b/builtin-diff-files.c index 2b578c714d..5b64011de8 100644 --- a/builtin-diff-files.c +++ b/builtin-diff-files.c @@ -59,8 +59,8 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix) (rev.diffopt.output_format & DIFF_FORMAT_PATCH)) rev.combine_merges = rev.dense_combined_merges = 1; - if (read_cache() < 0) { - perror("read_cache"); + if (read_cache_preload(rev.diffopt.paths) < 0) { + perror("read_cache_preload"); return -1; } result = run_diff_files(&rev, options); -- cgit v1.2.3