From: "Peter Eriksen" Subject: Re: [PATCH] read-tree --aggressive Date: Sat, 4 Feb 2006 12:52:01 +0100 Message-ID: <20060204115201.GA22333@ebar091.ebar.dtu.dk> References: <20060131213314.GA32131@ebar091.ebar.dtu.dk> <7v8xsr60n2.fsf@assigned-by-dhcp.cox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-From: git-owner@vger.kernel.org Sat Feb 04 13:13:30 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F5MI5-0001k0-L9 for gcvg-git@gmane.org; Sat, 04 Feb 2006 13:13:22 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932222AbWBDMNT (ORCPT ); Sat, 4 Feb 2006 07:13:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932340AbWBDMNT (ORCPT ); Sat, 4 Feb 2006 07:13:19 -0500 Received: from ebar091.ebar.dtu.dk ([192.38.93.106]:57477 "HELO ebar091.ebar.dtu.dk") by vger.kernel.org with SMTP id S932222AbWBDMNS (ORCPT ); Sat, 4 Feb 2006 07:13:18 -0500 Received: (qmail 22524 invoked by uid 5842); 4 Feb 2006 11:52:01 -0000 To: Git Mailing List Content-Disposition: inline In-Reply-To: <7v8xsr60n2.fsf@assigned-by-dhcp.cox.net> User-Agent: Mutt/1.5.6i Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: On Fri, Feb 03, 2006 at 11:31:13PM -0800, Junio C Hamano wrote: > "Peter Eriksen" writes: > > > In connection with Ian Molton's question about merge have I played a > > little with 'git merge' on the kernel sources. What I find is that a > > merge can take quite some time, but I'm not sure where that time exactly > > goes to. Here are the times I got: > > > > Recursive (default): 4m22.282s > > Resolve (-s resolve): 3m23.548s > > In your sample script, you do not disable the post-merge diff, > which is typically one of the most expensive part in the whole > merge, and I am wondering how fast a machine you are using to > get 4 minutes. The post-merge diff is generated by piping the > output of 'diff-tree -M' to 'apply --stat --summary', and that > step alone takes about 12 minutes wallclock time on my box X-<. > > Since my box is not as fast as yours, I've eliminated the > post-merge diff step and tried your final merge step like this: > > $ time git merge --no-summary -s resolve \ > 'Merging happily' HEAD v2.6.15 >/dev/null > > and got this: > > real 2m15.737s > user 1m43.320s > sys 0m26.690s I got this: real 0m51.661s user 0m28.302s sys 0m8.949s > With the attached patch, the most expensive part, which is the > repeated invocation of git-merge-one-file to remove many deleted > paths, is eliminated. The result is this. > > real 0m20.311s > user 0m15.780s > sys 0m4.150s I got this: real 0m20.221s user 0m6.456s sys 0m1.828s > This patch would not help recursive strategy, though. Calling > read-tree with --aggressive flag essentially disables the > benefit we would expect to get from it -- rename detection. Aha, so now I better understand where all the time goes. Most of the time is spend calculating the merge summary. After that the bottleneck was the large amount of git-merge-one-file invocations. With the aggressive patch applied it feels like the merge is mostly IO bound, which might explain why we get similar running times. I did get one run of 12s, but that was a lucky shot I guess. Repeated runs gave between 15s and 21s but most where close to 20s. Thanks, Peter