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

Re: [PATCH 2/2] pack-objects: fix threaded load balancing

From
Nicolas Pitre <nico@cam.org>
Date
Dec 10, 2007, 16:03 UTC
Message-ID
<alpine.LFD.0.99999.0712101048230.555@xanadu.home>
In-Reply-To
<9e4733910712092219kd86e576k33b11c93179f6475@mail.gmail.com>
On Mon, 10 Dec 2007, Jon Smirl wrote:
> It seems to be caused by looping over those runs of 100,000 identical
> hash entries.

As mentioned earlier, there simply can't be 100000 identical hash entries.

> 5091699 24.6407 :                       for (entry = index->hash[i]; entry < index->hash[i+1]; entry++) {
> 5301791 25.6575 :                               const unsigned char *ref = entry->ptr;

This loop is the very heart of the delta search code. It is normal to see it high on the graph. In some worst cases, this loop might even be entered for every byte in the source buffer.

And yet I bring you back to your observation about the fact that the source pack used for the repack (whether it is the 2.1GB pack or the 300MB pack) has a great influence on the performance outcome. The code above, though, would be executed the very exact number of times, and the exact amount of memory allocated, regardless of the source pack used (as long as you use -f with 'git repack' of course).

So this cannot be the culprit.
Nicolas
Previous: Jon SmirlNext: Nicolas Pitre
Message 9 of 16 in “pack-objects: fix threaded load balancing”
  1. 2/2 pack-objects: fix threaded load balancingNicolas Pitre, Dec 8, 2007
  2. Jeff KingDec 8, 2007
  3. Jon SmirlDec 10, 2007
  4. Jon SmirlDec 10, 2007
  5. Jon SmirlDec 10, 2007
  6. Jon SmirlDec 10, 2007
  7. Jon SmirlDec 10, 2007
  8. Jon SmirlDec 10, 2007
  9. Nicolas PitreDec 10, 2007
  10. Nicolas PitreDec 10, 2007
  11. Jon SmirlDec 10, 2007
  12. Nicolas PitreDec 10, 2007
  13. pack-objects: more threaded load balancing fix with often changed pathsNicolas Pitre, Dec 10, 2007
  14. Johannes SixtDec 11, 2007
  15. Nicolas PitreDec 11, 2007
  16. Johannes SixtDec 13, 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.