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

Re: [PATCH 1/1] Bypass expensive content comparsion during rename detection.

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 14, 2006, 11:18 UTC
Message-ID
<Pine.LNX.4.63.0612141214440.3635@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<20061214110858.GE1747@spearce.org>
Hi,
On Thu, 14 Dec 2006, Shawn Pearce wrote:
Show 6 quoted lines
> 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

Previous: Shawn PearceNext: Shawn Pearce
Message 5 of 6 in “Bypass expensive content comparsion during rename detection.”
  1. 1/1 Bypass expensive content comparsion during rename detection.Shawn O. Pearce, Dec 14, 2006
  2. Johannes SchindelinDec 14, 2006
  3. Shawn PearceDec 14, 2006
  4. Shawn PearceDec 14, 2006
  5. Johannes SchindelinDec 14, 2006
  6. Shawn PearceDec 14, 2006

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.