git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Nicolas PitreNext: Nicolas Pitre
Message 3 of 6 in “always start looking up objects in the last used pack first”
  1. always start looking up objects in the last used pack firstNicolas Pitre, May 31, 2007
  2. Nicolas PitreMay 31, 2007
  3. Shawn O. PearceMay 31, 2007
  4. Nicolas PitreMay 31, 2007
  5. Dana HowJun 2, 2007
  6. Dana HowJun 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.