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

Re: [PATCH WIP] sha1-lookup: make selection of 'middle' less aggressive

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 30, 2007, 21:49 UTC
Message-ID
<7vodc77t0o.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.1.00.0712301150120.32517@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 8 quoted lines
> On Sun, 30 Dec 2007, Junio C Hamano wrote:
>> 
>> With this patch, we actually see slight improvements in
>> execution time as well.  In the same partial kde repository
>> (3.0GB pack, 95MB idx; the numbers are from the same machine as
>> before, best of 5 runs):
>
> Ok, I tried this a year ago, and never got any real improvement.
Yes, I remember that one.
Show 6 quoted lines
> and I decided it wasn't worth it. Yours looks much better, and seems to 
> get a real performance improvement, so go for it, but I doubt that the 
> actual object lookup is really ever the main issue. I've never seen it 
> stand out in the real profiles, although if it is able to cut down on IO 
> (and your minor fault numbers are promising!), it might be more important 
> than I'd otherwise think.

The cost of the key comparison done in each round is insignificant compared to the actual cost of accessing the object data through zlib. The only potential performance benefit that could come from this patch to reduce the average number of rounds in the search is I/O reduction.

The only case I can think of that this may matter in real life is accessing only small number of objects in a history with a huge pack. Once you dig down the history deep enough to check enough number of objects inside a single process, you would need to touch every page of the mapped idx and the minor-fault gain rapidly diminishes.

Accessing only small number of objects in a huge history most often happens when building near the tip of the history (e.g. commit, rebase, merge), but these operations tend to deal with very young objects, often unpacked. We check pack first and then loose objects, so the search for young loose objects will benefit from the patch because the negative look-up to notice that they do not live in any pack also becomes cheaper, but I do not think it is such a big deal.

Previous: Linus TorvaldsNext: Marco Costalba
Message 7 of 14 in “sha1-lookup: more memory efficient search in sorted list of SHA-1”
  1. sha1-lookup: more memory efficient search in sorted list of SHA-1Junio C Hamano, Dec 30, 2007
  2. sha1-lookup: make selection of 'middle' less aggressiveJunio C Hamano, Dec 30, 2007
  3. Marco CostalbaDec 30, 2007
  4. Marco CostalbaDec 30, 2007
  5. Shawn O. PearceDec 31, 2007
  6. Linus TorvaldsDec 30, 2007
  7. Junio C HamanoDec 30, 2007
  8. Marco CostalbaDec 30, 2007
  9. Linus TorvaldsDec 31, 2007
  10. Marco CostalbaDec 31, 2007
  11. Jeff KingJan 1, 2008
  12. Marco CostalbaJan 1, 2008
  13. Marco CostalbaJan 1, 2008
  14. Pierre HabouzitJan 1, 2008

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.