From: Johannes Schindelin Date: Thu, 14 Dec 2006 11:18:30 GMT Subject: Re: [PATCH 1/1] Bypass expensive content comparsion during rename detection. Message-ID: 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