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

Re: cherry-pick very slow on big repository

From
Derrick Stolee <stolee@gmail.com>
Date
Nov 10, 2017, 12:59 UTC
Message-ID
<7e242038-50e5-2cfc-e810-401af78b8cdc@gmail.com>
In-Reply-To
<alpine.DEB.2.00.1711101333030.2391@ds9.cixit.se>
On 11/10/2017 7:37 AM, Peter Krefting wrote:
Show 23 quoted lines
> Jeff King:
>
>> Can you get a backtrace? I'd do something like:
>
> Seems that it spends most time in diffcore_count_changes(), that is 
> where it hits whenever I hit Ctrl+C (various line numbers 199-207 in 
> diffcore-delta.c; this is on the v2.15.0 tag).
>
> (gdb) bt
> #0  diffcore_count_changes (src=src@entry=0x55555db99970,
>     dst=dst@entry=0x55555d6a4810,
>     src_count_p=src_count_p@entry=0x55555db99998,
>     dst_count_p=dst_count_p@entry=0x55555d6a4838,
>     src_copied=src_copied@entry=0x7fffffffd3e0,
>     literal_added=literal_added@entry=0x7fffffffd3f0)
>     at diffcore-delta.c:203
> #1  0x00005555556dee1a in estimate_similarity (minimum_score=30000,
>     dst=0x55555d6a4810, src=0x55555db99970) at diffcore-rename.c:193
> #2  diffcore_rename (options=options@entry=0x7fffffffd4f0)
>     at diffcore-rename.c:560
> #3  0x0000555555623d83 in diffcore_std (
>     options=options@entry=0x7fffffffd4f0) at diff.c:5846
> ...

Git is spending time detecting renames, which implies you probably renamed a folder or added and deleted a large number of files. This rename detection is quadratic (# adds times # deletes).

You can remove this rename detection by running your cherry-pick with `git -c diff.renameLimit=1 cherry-pick ...`

See https://git-scm.com/docs/diff-config#diff-config-diffrenameLimit

Thanks, -Stolee

Previous: Peter KreftingNext: Peter Krefting
Message 4 of 13 in “cherry-pick very slow on big repository”
  1. Peter KreftingNov 10, 2017
  2. Jeff KingNov 10, 2017
  3. Peter KreftingNov 10, 2017
  4. Derrick StoleeNov 10, 2017
  5. Peter KreftingNov 10, 2017
  6. Kevin WillfordNov 10, 2017
  7. Peter KreftingNov 13, 2017
  8. Elijah NewrenNov 10, 2017
  9. Elijah NewrenNov 10, 2017
  10. Peter KreftingNov 13, 2017
  11. Elijah NewrenNov 13, 2017
  12. Peter KreftingNov 21, 2017
  13. Elijah NewrenNov 21, 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.