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

Re: diffcore-rename performance mode

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Sep 18, 2007, 22:12 UTC
Message-ID
<alpine.LFD.0.999.0709181510460.16478@woody.linux-foundation.org>
In-Reply-To
<20070918082321.GA9883@coredump.intra.peff.net>
On Tue, 18 Sep 2007, Jeff King wrote:
Show 20 quoted lines
> 
> With this patch:
> 
> diff --git a/diffcore-rename.c b/diffcore-rename.c
> index 6bde439..531a844 100644
> --- a/diffcore-rename.c
> +++ b/diffcore-rename.c
> @@ -362,10 +362,7 @@ void diffcore_rename(struct diff_options *options)
>  			m->score = estimate_similarity(one, two,
>  						       minimum_score);
>  			m->name_score = basename_same(one, two);
> -			diff_free_filespec_data(one);
>  		}
> -		/* We do not need the text anymore */
> -		diff_free_filespec_data(two);
>  		dst_cnt++;
>  	}
>  	/* cost matrix sorted by most to least similar pair */
> 
> My 20-minute diff becomes a 2-minute diff.

I think this is a reasonable patch, but only now *after* we limit the rename matrix.

The whole reason for freeing the filespec data was to avoid exploding the memory usage, but now that we aggressively limit the number of renames in flight anyway, I think we can probably remove the code that frees the file data in between all the rename similarity analysis.

			Linus
Previous: Jeff King
Message 13 of 13 in “diffcore-rename performance mode”
  1. Jeff KingSep 18, 2007
  2. Junio C HamanoSep 18, 2007
  3. Jeff KingSep 18, 2007
  4. Junio C HamanoSep 18, 2007
  5. Jeff KingSep 18, 2007
  6. Junio C HamanoSep 18, 2007
  7. Johannes SchindelinSep 18, 2007
  8. Jeff KingSep 25, 2007
  9. Jeff KingSep 25, 2007
  10. Andreas EricssonSep 25, 2007
  11. David KastrupSep 25, 2007
  12. Jeff KingSep 25, 2007
  13. Linus TorvaldsSep 18, 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.