From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Shawn Pearce <spearce@spearce.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [PATCH 1/1] Bypass expensive content comparsion during rename detection.
Date: Thu, 14 Dec 2006 12:18:30 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.63.0612141214440.3635@wbgn013.biozentrum.uni-wuerzburg.de> (raw)
In-Reply-To: <20061214110858.GE1747@spearce.org>
Hi,
On Thu, 14 Dec 2006, Shawn Pearce wrote:
> My first version of the patch had the hash comparsion right after we
> called diff_populate_filespec to get the size data. But then I realized
> that very often the sizes will be different and the src->size !=
> dst->size comparsion will tend to be true most of the time, thus saving
> us a (relatively) expensive hash comparsion, which we know must fail
> anyway if the sizes differed.
Ah! I misunderstood. Since the call to diff_populate_filespec was not
visible in the hunk, I erroneously assumed that you meant to _check_ the
sizes before checking the hashes.
But your explanation makes lots of sense to me. May I request a short
comment above the new code, like "let diff_populate_filespec() do its
thing since we need the filesize later on anyway, and having that, do the
cheaper filesize check before the more expensive hashcmp()"?
Ciao,
Dscho
next prev parent reply other threads:[~2006-12-14 11:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-14 10:07 [PATCH 1/1] Bypass expensive content comparsion during rename detection Shawn O. Pearce
2006-12-14 10:53 ` Johannes Schindelin
2006-12-14 11:08 ` Shawn Pearce
2006-12-14 11:13 ` Shawn Pearce
2006-12-14 11:18 ` Johannes Schindelin [this message]
2006-12-14 11:50 ` Shawn Pearce
-- strict thread matches above, loose matches on Subject: below --
2006-12-14 11:26 Junio C Hamano
2006-12-14 12:13 ` Shawn Pearce
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.63.0612141214440.3635@wbgn013.biozentrum.uni-wuerzburg.de \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=spearce@spearce.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).