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

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

From
Jon Smirl <jonsmirl@gmail.com>
Date
Dec 10, 2007, 06:19 UTC
Message-ID
<9e4733910712092219kd86e576k33b11c93179f6475@mail.gmail.com>
In-Reply-To
<9e4733910712092206o40e0c748s3796b95f637bf2b3@mail.gmail.com>

It seems to be caused by looping over those runs of 100,000 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;

228772  1.1071 :        while (data < top) {
223646  1.0823 :                if (msize < 4096) {
               :                        struct index_entry *entry;
  5862  0.0284 :                        val ^= U[data[-RABIN_WINDOW]];
753004  3.6441 :                        val = ((val << 8) | *data) ^
T[val >> RABIN_SHIFT];
1232556  5.9648 :                       i = val & index->hash_mask;
5091699 24.6407 :                       for (entry = index->hash[i];
entry < index->hash[i+1]; entry++) {
5301791 25.6575 :                               const unsigned char
*ref = entry->ptr;
               :                                const unsigned char *src = data;
 25919  0.1254 :                                unsigned int ref_size
= ref_top - ref;
740077  3.5815 :                                if (entry->val != val)
               :                                        continue;
   331  0.0016 :                                if (ref_size > top - src)
 83804  0.4056 :                                        ref_size = top - src;
 25059  0.1213 :                                if (ref_size <= msize)
               :                                        break;
1269621  6.1442 :                               while (ref_size-- &&
*src++ == *ref)
 42122  0.2038 :                                        ref++;
 14362  0.0695 :                                if (msize < ref - entry->ptr) {
               :                                        /* this is our
best match so far */
 10452  0.0506 :                                        msize = ref -
entry->ptr;
  6882  0.0333 :                                        moff =
entry->ptr - ref_data;
  6382  0.0309 :                                        if (msize >=
4096) /* good enough */
               :                                                break;
               :                                }
               :                        }
-- 
Jon Smirl
jonsmirl@gmail.com
Previous: Jon SmirlNext: Nicolas Pitre
Message 8 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.