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

Re: cherry-pick is slow

From
DRDmitry Risenberg <dmitry.risenberg@gmail.com>
Date
May 13, 2012, 15:39 UTC
Message-ID
<CAPZ_ugbV6hB+8z8UsQKdHhxGuHbLzC5WK19mK7M8k2tMz+mtXw@mail.gmail.com>
In-Reply-To
<CAPc5daW6eBLUf55_Qk+4bA6Y16TehfOUGc1xFzhib9vm=8O2Yw@mail.gmail.com>
2012/5/13 Junio C Hamano <gitster-vger@pobox.com>:
Show 20 quoted lines
> On Sat, May 12, 2012 at 3:39 PM, Dmitry Risenberg
> <dmitry.risenberg@gmail.com> wrote:
>>
>> Hello.
>>
>> I have a very big git repository (the .git directory is about 5.3 Gb),
>> which is a copy of an svn repository fetched via git-svn. In fact
>> there are a few repositories ("working copies") that share the same
>> .git directory (via symlinks), in which I have different svn branches
>> checked out. Now I want to merge a commit from one svn branch to
>> another via git cherry-pick. The commit contains diff in only one
>> file. So I do
>>
>> git cherry-pick <commit>
>>
>> And the operation takes tens of seconds to finish. In "top" output I
>> see that git process uses almost no CPU, but has hundreds of page
>> faults, so I assume that it is reading a lot of files from disk.
>
> Wild guess: poorly (or worse yet, never) packed repository?

You were absolutely right. I set "gc.auto = 0" during the initial checkout of svn and forgot to turn it on afterwards. After running "git gc", my repo became two times smaller, and git operations are now running much faster.

However, cherry-picking is still not as fast as I expected it to be - cherry-picking a single-file commit takes about 14-15 seconds, fully using one CPU core. Anything else I can improve?

-- 
Dmitry Risenberg
Previous: Junio C HamanoNext: Jeff King
Message 3 of 9 in “cherry-pick is slow”
  1. Dmitry RisenbergMay 12, 2012
  2. Junio C HamanoMay 13, 2012
  3. Dmitry RisenbergMay 13, 2012
  4. Jeff KingMay 14, 2012
  5. Jeff KingMay 15, 2012
  6. Paweł SikoraMay 15, 2012
  7. Junio C HamanoMay 15, 2012
  8. Junio C HamanoMay 15, 2012
  9. Jeff KingMay 19, 2012

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.