Optimize the three-way merge of git-read-tree
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 Aug 2007 19:53:51 +0000 (12:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 11 Aug 2007 06:02:14 +0000 (23:02 -0700)
commit566b5c057c452d04605805ea2f7af210c6fb9b59
tree61191e80bae32d7f74fb433fc2a6f74d145162c3
parentcbbb218f8bd219d79907623a9304496ee69d8abd
Optimize the three-way merge of git-read-tree

As mentioned, the three-way case *should* be as trivial as the
following. It passes all the tests, and I verified that a conflicting
merge in the 100,000 file horror-case merged correctly (with the conflict
markers) in 0.687 seconds with this, so it works, but I'm lazy and
somebody else should double-check it [jc: followed all three-way merge
codepaths and verified it removes when it should].

Without this patch, the merge took 8.355 seconds, so this patch
really does make a huge difference for merge performance with lots and
lots of files, and we're not talking percentages, we're talking
orders-of-magnitude differences!

Now "unpack_trees()" is just fast enough that we don't need to avoid it
(although it's probably still a good idea to eventually convert it to use
the traverse_trees() infrastructure some day - just to avoid having
extraneous tree traversal functions).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
unpack-trees.c