Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Junio C Hamano
Jeff King writes: > - this patch probably adds "unsorted tree" to the list of breakages > that would cause us to skip rename detection. I don't know if that's > actually possible in practice (i.e., do we end up sorting the > diffq elsewhere anyway?). I also wondered

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Jeff King
On Thu, Apr 20, 2017 at 02:08:46PM -0400, Jeff Hostetler wrote: > > That's not the minimal change you were going for, but I think the end > > result is simpler and more consistent. > > OK, let me take a stab at something like that and > see where it takes me. Thanks. I set the patch as a lump,

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Jeff Hostetler
On 4/20/2017 12:13 PM, Jeff King wrote: On Thu, Apr 20, 2017 at 10:00:04AM -0400, Jeff Hostetler wrote: Perhaps the thing to learn from this (and the other ones) is that we have lots of places where we are building a sorted list by iterating over a sorted list. The insert routines are

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Jeff King
On Thu, Apr 20, 2017 at 10:00:04AM -0400, Jeff Hostetler wrote: > Perhaps the thing to learn from this (and the other ones) is that > we have lots of places where we are building a sorted list by > iterating over a sorted list. The insert routines are general > purpose and cannot assume this, so

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Jeff King
On Thu, Apr 20, 2017 at 12:40:52PM +0200, Johannes Schindelin wrote: > > > Teach register_rename_src() to see if new file pair can simply be > > > appended to the rename_src[] array before performing the binary search > > > to find the proper insertion point. > > > > I guess your perf results

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Jeff Hostetler
On 4/18/2017 11:18 PM, Jeff King wrote: On Tue, Apr 18, 2017 at 10:56:08PM -0400, Jeff King wrote: When adding many things, we often just append and then sort at the end after we finished adding. I wonder if recent "check the last one and append" optimization beats that strategy. The big

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Johannes Schindelin
Hi Peff, On Tue, 18 Apr 2017, Jeff King wrote: > On Tue, Apr 18, 2017 at 07:44:21PM +, g...@jeffhostetler.com wrote: > > > From: Jeff Hostetler > > > > Teach register_rename_src() to see if new file pair can simply be > > appended to the rename_src[] array before

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-18 Thread Jeff King
On Tue, Apr 18, 2017 at 10:56:08PM -0400, Jeff King wrote: > > When adding many things, we often just append and then sort at the > > end after we finished adding. I wonder if recent "check the last > > one and append" optimization beats that strategy. > > The big question is whether we need to

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-18 Thread Jeff King
On Tue, Apr 18, 2017 at 07:45:05PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > On Tue, Apr 18, 2017 at 07:44:21PM +, g...@jeffhostetler.com wrote: > > > >> From: Jeff Hostetler > >> > >> Teach register_rename_src() to see if new file pair

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-18 Thread Junio C Hamano
Jeff King writes: > On Tue, Apr 18, 2017 at 07:44:21PM +, g...@jeffhostetler.com wrote: > >> From: Jeff Hostetler >> >> Teach register_rename_src() to see if new file pair >> can simply be appended to the rename_src[] array before >> performing the

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-18 Thread Jeff King
On Tue, Apr 18, 2017 at 07:44:21PM +, g...@jeffhostetler.com wrote: > From: Jeff Hostetler > > Teach register_rename_src() to see if new file pair > can simply be appended to the rename_src[] array before > performing the binary search to find the proper insertion >

[PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-18 Thread git
From: Jeff Hostetler Teach register_rename_src() to see if new file pair can simply be appended to the rename_src[] array before performing the binary search to find the proper insertion point. This is a performance optimization. This routine is called during