carlosmn/libgit2 — comment on commit 6f38bf6e78f21ace75998ea6ae5903ad541d86a6
File:  line 0
By carlosmn:

On Fri, Oct 28, 2011 at 02:24:32PM -0700, Jeff King wrote:
> On Fri, Oct 28, 2011 at 11:59:59AM -0700, Carlos Martín Nieto wrote:
>
> > I remembered there was actually a sensible reason why I chose to do a
> > tree search. The idea was to make it faster when we there were a lot
> > of additions by figuring out how many there were and signalling all of
> > them instead of comparing each addition in the list. It probably
> > doesn't make it that much faster, though.
>
> I don't see how your way makes that faster, though. You only signal a
> chunk of additions if they are at the end, which is the same as in my
> proposed code. If you have an addition (or deletion) in the middle, you
> will end up just signaling one at a time anyway.

Yes, I implemented your proposal. I deicided it's much easier to read
if we only compare one pair of entries in each loop iteration. We'll
have to benchmark whether trying to be more clever about it actually
brings us any speed improvements in large trees.

cmn