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

Re: Why are ref_lists sorted?

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Mar 19, 2007, 05:22 UTC
Message-ID
<Pine.LNX.4.64.0703190520150.24247@beast.quantumfyre.co.uk>
In-Reply-To
<Pine.LNX.4.64.0703190321370.28570@beast.quantumfyre.co.uk>
On Mon, 19 Mar 2007, Julian Phillips wrote:
Show 8 quoted lines
> A bit of investigation showed this to be due to the first attempt to read a 
> ref causing the packed refs to be loaded.  In my test repo the packed-refs 
> file has over 9000 entries, but I still thought that it would load faster 
> than that.  It turns out that the overhead is from sorting the refs when 
> building the ref_list.  If I remove the code for sorting the entries I lose 
> that initial 1s delay, without appearing to break anything in the fetch. 
> However I assume that it's there for a reason ...
>

Actually, it's worse than that ... I forgot about the other end. If I point fetch at an upload-pack with the sorted removed the time goes down by another second. So that sorting accounts for 2 of the 3s ...

-- 
Julian

  ---
Know thyself.  If you need help, call the C.I.A.
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 4 of 7 in “Why are ref_lists sorted?”
  1. Julian PhillipsMar 19, 2007
  2. Junio C HamanoMar 19, 2007
  3. Shawn O. PearceMar 19, 2007
  4. Julian PhillipsMar 19, 2007
  5. Shawn O. PearceMar 19, 2007
  6. Junio C HamanoMar 19, 2007
  7. Linus TorvaldsMar 19, 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.