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

Re: cherry-pick very slow on big repository

From
Jeff King <peff@peff.net>
Date
Nov 10, 2017, 10:20 UTC
Message-ID
<20171110102011.yqtka6a3wmgcvkl6@sigill.intra.peff.net>
In-Reply-To
<alpine.DEB.2.00.1711100959300.2391@ds9.cixit.se>
On Fri, Nov 10, 2017 at 10:39:39AM +0100, Peter Krefting wrote:
Show 7 quoted lines
> Running strace, it seems like it is doing lstat(), open(), mmap(), close()
> and munmap() on every single file in the repository, which takes a lot of
> time.
> 
> I thought it was just updating the status, but "git status" returns
> immediately, while cherry-picking takes several minutes for every
> cherry-pick I do.

It kind of sounds like a temporary index is being refreshed that doesn't have the proper stat information.

Can you get a backtrace? I'd do something like:
  - gdb --args git cherry-pick ...
  - 'r' to run
  - give it a few seconds to hit the CPU heavy part, then ^C
  - 'bt' to generate the backtrace

which should give a sense of which code path is leading to the slowdown (or of course use real profiling tools, but if the slow path is taking 6 minutes, you'll be likely to stop in the middle of it ;) ).

-Peff
Previous: Peter KreftingNext: Peter Krefting
Message 2 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.