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

Re: git clean performance issues

From
erik elfström <erik.elfstrom@gmail.com>
Date
Apr 4, 2015, 20:39 UTC
Message-ID
<CAMpP7NZ8OD5or8H11OvuH1nq+qe-btKCsQnhas6+7SRYE1M1Tw@mail.gmail.com>
In-Reply-To
<20150404195507.GA31763@peff.net>

That looks like the same issue. The "use is_git_directory" approach sounds good to me, is that the direction you would prefer? I can try to cobble something together although I must warn you I have zero previous experience with this code base so a few iterations will probably be needed.

/Erik
On Sat, Apr 4, 2015 at 9:55 PM, Jeff King <peff@peff.net> wrote:
Show 22 quoted lines
> On Sat, Apr 04, 2015 at 08:32:45PM +0200, erik elfström wrote:
>
>> In my scenario get_ref_cache will be called 10000+ times, each time
>> with a new path. The final few calls will need to search through and
>> compare 10000+ entries before realizing that there is no existing
>> entry. This quickly ads up to 100 million+ calls to strcmp().
>>
>> From what I can understand, the calls to get_ref_cache in this
>> scenario will never do any useful work. Is this correct? If so, would
>> it be possible to bypass it, maybe by calling
>> resolve_gitlink_ref_recursive directly or by using some other way of
>> checking for the presence of a git repo in clean.c:remove_dirs?
>
> I think this is the same issue that was discussed here:
>
>   http://thread.gmane.org/gmane.comp.version-control.git/265560/focus=265585
>
> There is some discussion of a possible fix in that thread. I was hoping
> that Andreas was going to look further and produce a patch, but I
> imagine he got busy with other things. Do you want to try picking it up?
>
> -Peff
Previous: Jeff KingNext: Jeff King
Message 3 of 6 in “git clean performance issues”
  1. erik elfströmApr 4, 2015
  2. Jeff KingApr 4, 2015
  3. erik elfströmApr 4, 2015
  4. Jeff KingApr 4, 2015
  5. Andreas KreyNov 13, 2015
  6. Jeff KingNov 13, 2015

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.