[PATCH] Speedup recursive by flushing index only once for all entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Merge-recursive is very slow in repos with lots of files,
especially if lots of them change absolutely identically.
Updating index once after all of them changes speedups
merge quite noticable.

Signed-off-by: Alex Riesen <raa.lkml@xxxxxxxxx>
---

Johannes, I remember suggesting to do index flush for all
entries instead for every entry. It is already quite time ago,
but ... was there any reasons for not doing this?
The patch speeds it up a lot and no wonder: index is 6Mb
here, and this is cygwin.

merge-recursive.c |    5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
From d0e4d791cef8b307b32954a8b80c4aabd41755a9 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@xxxxxxxxx>
Date: Thu, 4 Jan 2007 11:22:47 +0100
Subject: Speedup recursive by flushing index only once for all entries

Signed-off-by: Alex Riesen <raa.lkml@xxxxxxxxx>
---

 merge-recursive.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/merge-recursive.c b/merge-recursive.c
index bac16f5..4d3a2ce 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1083,9 +1083,6 @@ static int process_entry(const char *path, struct stage_data *entry,
 	} else
 		die("Fatal merge failure, shouldn't happen.");
 
-	if (cache_dirty)
-		flush_cache();
-
 	return clean_merge;
 }
 
@@ -1133,6 +1130,8 @@ static int merge_trees(struct tree *head,
 			if (!process_entry(path, e, branch1, branch2))
 				clean = 0;
 		}
+		if (cache_dirty)
+			flush_cache();
 
 		path_list_clear(re_merge, 0);
 		path_list_clear(re_head, 0);
-- 
1.5.0.rc0.g8bc4b-dirty


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]