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

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 19, 2017, 02:45 UTC
Message-ID
<xmqqd1c9cdzi.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170419013214.q35jarvmk5jhqdyi@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 21 quoted lines
> On Tue, Apr 18, 2017 at 07:44:21PM +0000, git@jeffhostetler.com wrote:
>
>> From: Jeff Hostetler <jeffhost@microsoft.com>
>> 
>> Teach register_rename_src() to see if new file pair
>> can simply be appended to the rename_src[] array before
>> performing the binary search to find the proper insertion
>> point.
>
> I guess your perf results show some minor improvement. But I suspect
> this is because your synthetic repo does not resemble the real world
> very much. You're saving a few strcmps, but for each of those files
> you're potentially going to have actually zlib inflate the object
> contents and do similarity analysis.
>
> So "absurd number of files doing 100% exact renames" is the absolute
> best case, and it saves a few percent.
>
> I dunno. It is not that much code _here_, but I'm not excited about the
> prospect of sprinkling this same "check the last one" optimization all
> over the code base. I wonder if there's some way to generalize it.

When adding many things, we often just append and then sort at the end after we finished adding. I wonder if recent "check the last one and append" optimization beats that strategy.

Previous: Jeff KingNext: Jeff King
Message 4 of 13 in “diffcore-rename speedup”
  1. diffcore-rename speedupgit@jeffhostetler.com, Apr 18, 2017
  2. diffcore-rename: speed up register_rename_srcgit@jeffhostetler.com, Apr 18, 2017
  3. Jeff KingApr 19, 2017
  4. Junio C HamanoApr 19, 2017
  5. Jeff KingApr 19, 2017
  6. Jeff KingApr 19, 2017
  7. Jeff HostetlerApr 20, 2017
  8. Jeff KingApr 20, 2017
  9. Jeff HostetlerApr 20, 2017
  10. Jeff KingApr 20, 2017
  11. Junio C HamanoApr 21, 2017
  12. Johannes SchindelinApr 20, 2017
  13. Jeff KingApr 20, 2017

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.