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

Re: cherry-pick is slow

From
PSPaweł Sikora <pawel.sikora@agmk.net>
Date
May 15, 2012, 18:57 UTC
Message-ID
<29715654.5ciT9KkCQq@localhost>
In-Reply-To
<20120515132451.GA25378@sigill.intra.peff.net>
On Tuesday 15 of May 2012 09:24:51 Jeff King wrote:
Show 16 quoted lines
> [let's keep this on-list so others can benefit from the discussion]
> 
> On Tue, May 15, 2012 at 12:38:59PM +0400, Dmitry Risenberg wrote:
> 
> > > It's probably detecting renames as part of the merge, which can be
> > > expensive if the thing you are cherry-picking is far away from HEAD. You
> > > can try setting the merge.renamelimit config variable to something small
> > > (like 1; setting it to 0 means "no limit").
> > 
> > I set it to 1, but it didn't help at all - cherry-pick time is still
> > about the same.
> 
> OK, then my guess was probably wrong. You'll have to try profiling (if
> you are on Linux, "perf record git cherry-pick ..."; perf report" is the
> simplest way). Or if the repository is publicly available, I can do a
> quick profile run.

i have two big repos (few GB) and cherry-pick utilizes i/o and cpu heavy. timing varies from few seconds on raid-0 (2x500GB) to ~30 second on linear lvm (few TB). here's perf report:

 36,24%  git  libc-2.15.so        [.] __memmove_ssse3_back
  7,04%  git  libz.so.1.2.7       [.] inflate_fast
  6,17%  git  libz.so.1.2.7       [.] inflate
  5,53%  git  git                 [.] xdl_recs_cmp
  3,04%  git  libc-2.15.so        [.] __memcmp_sse4_1
  2,54%  git  libz.so.1.2.7       [.] inflate_table
  1,83%  git  libc-2.15.so        [.] __strcmp_sse42
  1,52%  git  libc-2.15.so        [.] __memcpy_ssse3_back
  1,49%  git  git                 [.] match_trees
  1,39%  git  libc-2.15.so        [.] _int_malloc
  1,18%  git  libz.so.1.2.7       [.] adler32
  1,08%  git  git                 [.] do_head_ref
  1,02%  git  git                 [.] splice_tree
  0,83%  git  libc-2.15.so        [.] __strlen_sse2_pminub
  0,71%  git  [kernel.kallsyms]   [k] _raw_spin_lock
  0,68%  git  git                 [.] shift_tree_by
  0,67%  git  libc-2.15.so        [.] _int_free
  0,63%  git  [kernel.kallsyms]   [k] __d_lookup_rcu
  0,60%  git  [kernel.kallsyms]   [k] link_path_walk
  0,57%  git  git                 [.] get_shallow_commits
(...)
Previous: Jeff KingNext: Junio C Hamano
Message 6 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.