Re: [PATCH 1/2] pack-objects: break out of want_object loop early

2016-07-27 Thread Jeff King
On Wed, Jul 27, 2016 at 02:28:32PM -0700, Junio C Hamano wrote: > On Wed, Jul 27, 2016 at 2:13 PM, Jeff King wrote: > > ... But two is that I've > > wondered if we can do even better with a most-recently-used cache > > instead of the last_pack_found hack. So I'm trying to implement and > > measur

Re: [PATCH 1/2] pack-objects: break out of want_object loop early

2016-07-27 Thread Junio C Hamano
On Wed, Jul 27, 2016 at 2:13 PM, Jeff King wrote: > ... But two is that I've > wondered if we can do even better with a most-recently-used cache > instead of the last_pack_found hack. So I'm trying to implement and > measure that (both for this loop, and to see if it does better in > find_pack_ent

Re: [PATCH 1/2] pack-objects: break out of want_object loop early

2016-07-27 Thread Jeff King
On Tue, Jul 26, 2016 at 02:38:28PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > I got side-tracked by adding a t/perf test to show off the improvement. > > It's rather tricky to get right and takes a long time to run. I _think_ > > I have it now, but am waiting for results. :) > > Wel

Re: [PATCH 1/2] pack-objects: break out of want_object loop early

2016-07-26 Thread Junio C Hamano
Jeff King writes: > I got side-tracked by adding a t/perf test to show off the improvement. > It's rather tricky to get right and takes a long time to run. I _think_ > I have it now, but am waiting for results. :) Well, then I'd stop here and wait for the reroll to requeue. Thanks. -- To unsub

Re: [PATCH 1/2] pack-objects: break out of want_object loop early

2016-07-26 Thread Jeff King
On Tue, Jul 26, 2016 at 01:38:47PM -0700, Junio C Hamano wrote: > Jeff King writes: > > >> I do not mind too much about having to check two bools twice. But > >> given that the reason why I was confused was because I didn't see > >> why we need to pass the two "return 0" conditions at least onc

Re: [PATCH 1/2] pack-objects: break out of want_object loop early

2016-07-26 Thread Junio C Hamano
Jeff King writes: >> I do not mind too much about having to check two bools twice. But >> given that the reason why I was confused was because I didn't see >> why we need to pass the two "return 0" conditions at least once >> before we decide that we do not need the "return 0" thing at all, >> a

Re: [PATCH 1/2] pack-objects: break out of want_object loop early

2016-07-25 Thread Jeff King
On Mon, Jul 25, 2016 at 02:52:24PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > if (!*found_pack) { > > ... first find! fill in found pack, etc ... > > } > > if (exclude) > > return 1; > > if (incremental) > > return 0; > > if (!ignore_packed_keep && !local) > >

Re: [PATCH 1/2] pack-objects: break out of want_object loop early

2016-07-25 Thread Jeff King
On Mon, Jul 25, 2016 at 12:56:23PM -0700, Junio C Hamano wrote: > > This function loops through each existing packfile, looking > > for the object. When we find it, we mark the pack/offset > > combo for later use. However, we can't just return "yes, we > > want it" at that point. If --honor-pack-k

Re: [PATCH 1/2] pack-objects: break out of want_object loop early

2016-07-25 Thread Junio C Hamano
Jeff King writes: > if (!*found_pack) { > ... first find! fill in found pack, etc ... > } > if (exclude) > return 1; > if (incremental) > return 0; > if (!ignore_packed_keep && !local) > break; /* effectively return 1, but I think the break is more clear */ > if

Re: [PATCH 1/2] pack-objects: break out of want_object loop early

2016-07-25 Thread Junio C Hamano
Jeff King writes: > When pack-objects collects the list of objects to pack > (either from stdin, or via its internal rev-list), it > filters each one through want_object_in_pack(). > > This function loops through each existing packfile, looking > for the object. When we find it, we mark the pack/

[PATCH 1/2] pack-objects: break out of want_object loop early

2016-07-25 Thread Jeff King
When pack-objects collects the list of objects to pack (either from stdin, or via its internal rev-list), it filters each one through want_object_in_pack(). This function loops through each existing packfile, looking for the object. When we find it, we mark the pack/offset combo for later use. How