Re: [PATCH] always start looking up objects in the last used pack first
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- May 31, 2007, 05:02 UTC
- Message-ID
- <20070531050211.GV7044@spearce.org>
- In-Reply-To
- <alpine.LFD.0.99.0705302152180.11491@xanadu.home>
Nicolas Pitre <nico@cam.org> wrote:
> Pack Sort w/o this patch w/ this patch > ------------------------------------------------------------- > recent objects last 26.4s 20.9s > recent objects first 24.9s 18.4s
Looks pretty good.
Show 8 quoted lines
> + next: > + if (p == last_found) > + p = packed_git; > + else > + p = p->next; > + if (p == last_found) > + p = p->next; > + } while (p);
So if we didn't find the object in the pack that we found the last object in, we restart our search with the most recent pack? Why not just go to p->next and loop around? If we missed in this pack and the packs are sorted by recency, wouldn't we want to just search the next pack?
-- Shawn.