Re: [PATCH v6 0/3] read-cache: speed up add_index_entry

2017-04-08 Thread Jeff King
On Fri, Apr 07, 2017 at 02:27:24PM -0400, Jeff Hostetler wrote: > > Just thinking about this algorithmically for a moment. You're saving the > > binary search when the input is given in sorted order. But in other > > cases you're adding an extra strcmp() before the binary search begins. > > So it'

Re: [PATCH v6 0/3] read-cache: speed up add_index_entry

2017-04-07 Thread Jeff Hostetler
On 4/7/2017 12:46 AM, Jeff King wrote: On Thu, Apr 06, 2017 at 04:34:39PM +, g...@jeffhostetler.com wrote: Teach add_index_entry_with_check() and has_dir_name() to avoid index lookups if the given path sorts after the last entry in the index. This saves at least 2 binary searches per ent

Re: [PATCH v6 0/3] read-cache: speed up add_index_entry

2017-04-06 Thread Jeff King
On Thu, Apr 06, 2017 at 04:34:39PM +, g...@jeffhostetler.com wrote: > Teach add_index_entry_with_check() and has_dir_name() > to avoid index lookups if the given path sorts after > the last entry in the index. > > This saves at least 2 binary searches per entry. > > This improves performance