From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Nicolas Pitre" <nico@cam.org>
Cc: "Junio C Hamano" <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 2/2] pack-objects: fix threaded load balancing
Date: Mon, 10 Dec 2007 01:19:26 -0500 [thread overview]
Message-ID: <9e4733910712092219kd86e576k33b11c93179f6475@mail.gmail.com> (raw)
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
next prev parent reply other threads:[~2007-12-10 6:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-08 5:03 [PATCH 2/2] pack-objects: fix threaded load balancing Nicolas Pitre
2007-12-08 9:18 ` Jeff King
2007-12-10 4:10 ` Jon Smirl
2007-12-10 4:30 ` Jon Smirl
2007-12-10 5:23 ` Jon Smirl
2007-12-10 5:59 ` Jon Smirl
2007-12-10 6:06 ` Jon Smirl
2007-12-10 6:19 ` Jon Smirl [this message]
2007-12-10 16:03 ` Nicolas Pitre
2007-12-10 16:14 ` Nicolas Pitre
2007-12-10 17:06 ` Jon Smirl
2007-12-10 18:21 ` Nicolas Pitre
2007-12-10 19:19 ` [PATCH] pack-objects: more threaded load balancing fix with often changed paths Nicolas Pitre
2007-12-11 17:02 ` [PATCH 2/2] pack-objects: fix threaded load balancing Johannes Sixt
2007-12-11 17:28 ` Nicolas Pitre
2007-12-13 7:15 ` Johannes Sixt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9e4733910712092219kd86e576k33b11c93179f6475@mail.gmail.com \
--to=jonsmirl@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nico@cam.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).