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

Re: slow git-cherry-pick.

From
PSPaweł Sikora <pawel.sikora@agmk.net>
Date
Dec 3, 2013, 19:31 UTC
Message-ID
<2679995.THr9ekVpkO@localhost.localdomain>
In-Reply-To
<xmqqd2loz92n.fsf@gitster.dls.corp.google.com>
On Monday 25 of November 2013 09:26:40 Junio C Hamano wrote:
> Paweł Sikora <pawel.sikora@agmk.net> writes:
> > On Sunday 24 of November 2013 19:47:10 Duy Nguyen wrote:
> >> On Sun, Nov 24, 2013 at 5:45 PM, Paweł Sikora <pawel.sikora@agmk.net> 
wrote:
Show 26 quoted lines
> >> > i've recently reinstalled a fresh system (fc20-beta) on my workstation
> >> > and observing a big slowdown on git cherry-pick operation
> >> > (git-1.8.4.2-1).
> >> > the previous centos installation with an old git version works faster
> >> > (few seconds per cherry pick). now the same operation takes >1 min.
> >> 
> >> What is the git version before the reinstallation?
> > 
> > git-1.7.11.3-1.el5.rf.
> > 
> > i've checked this version on another machine with centos-5.$latest
> > and it does similar amout of stat/read operation quickly (~6s).
> > this "fast" centos-5 machine has /home on raid-0 (2x500GB) while
> > my "slow (>1min)" workstation has /home on linear lvm (250G+1T).
> > 
> > so, i suppose that my "slow" working copy crosses disks boundary
> > or spread over 1TB drive and the random git i/o impacts performance.
> > 
> > the question still remains - does the git need to scan whole checkout
> > during picking well defined set of files?
> 
> We do update-index to see what local changes you have upfront in
> order to avoid stomping on them (and we do not know upfront what
> paths the cherry-picked commit would change, given that there may be
> renames involved), so the answer is unfortunately yes, we would need
> to do lstat(2) the whole thing.

this is quite weird for me (user). git pull also fetches objects from server and aborts user's action if working copy contains uncommitted modifications on files that will be modified by incoming objects.

from the other side, the cherry-pick needs to stat() the whole working copy to achieve similar precondition. looks like suboptimal implementation.

> Doing that lstat(2) more lazily and do away with the update-index
> might be possible, but I suspect that may be quite a lot of work.
maybe you can use the existing implementation used by 'pull' ?
-- 
gpg key fingerprint = 60B4 9886 AD53 EB3E 88BB  1EB5 C52E D01B 683B 9411
Previous: Junio C HamanoNext: Thomas Rast
Message 6 of 9 in “slow git-cherry-pick.”
  1. Paweł SikoraNov 24, 2013
  2. Duy NguyenNov 24, 2013
  3. Duy NguyenNov 24, 2013
  4. Paweł SikoraNov 24, 2013
  5. Junio C HamanoNov 25, 2013
  6. Paweł SikoraDec 3, 2013
  7. Thomas RastDec 3, 2013
  8. Duy NguyenDec 4, 2013
  9. Paweł SikoraDec 4, 2013

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.