Re: Bottlenecks in git merge
From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:17
On Wed, 1 Feb 2006, Petr Baudis wrote:
xpasky@machine[0:0]~/linux-2.6.git$ echo -e '#!/bin/sh\n/bin/true' >r && chmod a+x r xpasky@machine[0:0]~/linux-2.6.git$ time git-merge-index -o ./r -a real 0m3.827s user 0m1.788s sys 0m2.004s xpasky@machine[0:0]~/linux-2.6.git$ time git-merge-index -o ~/git-pb/git-merge-one-file -a [lots of "Removing"] real 1m21.773s user 0m30.806s sys 0m13.248s The costs are apparently in git-update-index, not in the shell.
Btw, this is where "oprofile" really shines. You can get exact listings of which symbols in which programs are taking up CPU-time, even when the time is spent in hundreds of different executions of a program. Me, I'm too lazy to use it often, but not too lazy to point others towards it. You do need to have kernel support for it compiled in, and it works better on certain CPU's (that have supported counters) than on others. Linus