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

Re: Git very slow ?

From
David Kastrup <dak@gnu.org>
Date
Mar 8, 2015, 19:37 UTC
Message-ID
<87sidfmgag.fsf@fencepost.gnu.org>
In-Reply-To
<20150308192045.GB32504@milliways>
Ken Moffat <zarniwhoop@ntlworld.com> writes:
Show 36 quoted lines
> On Sun, Mar 08, 2015 at 05:21:22PM +0100, David Kastrup wrote:
>
>> Particularly not git-blame in 2.1.  I should be quite surprised to see
>> any git-blame call running noticeably slower in 2.1 than in any
>> preceding version.
>> 
>> What may have happened is that the repository recently got repacked
>> aggressively and thus any access to older revisions got slower.
>> However, that change would be mostly tied to the repository rather than
>> the version of Git you access it with.
>> 
> That is possible - well, not recently-recently, but I might have
> repacked my repo of buildscripts some time last year.  Running
>  ls -al .git
> in that repository gives me:
> drwxr-xr-x   8 ken 100   4096 Mar  8 16:08 .
> drwxr-xr-x  48 ken 100   4096 Mar  8 03:05 ..
> -rw-r--r--   1 ken 100    220 May 12  2014 BRANCH_DESCRIPTION
> drwxr-xr-x   2 ken 100   4096 Apr 13  2010 branches
> -rw-r--r--   1 ken 100    470 Mar  8 16:08 COMMIT_EDITMSG
> -rw-r--r--   1 ken 100    566 May 17  2014 config
> -rw-r--r--   1 ken 100     73 May  1  2010 description
> -rw-r--r--   1 ken 100 196439 Sep 17 21:56 gitk.cache
> -rw-rw-rw-   1 ken 100     29 Feb  8 22:19 HEAD
> drwxr-xr-x   2 ken 100   4096 May  1  2010 hooks
> -rw-r--r--   1 ken 100 218255 Mar  8 16:07 index
> drwxr-xr-x   2 ken 100   4096 Sep 16  2013 info
> drwxr-xr-x   3 ken 100   4096 Sep 16  2013 logs
> drwxr-xr-x 260 ken 100   4096 Nov 12  2013 objects
> -rw-r--r--   1 ken 100     41 Nov 11 06:05 ORIG_HEAD
> -rw-r--r--   1 ken 100   1879 Sep 16  2013 packed-refs
> drwxr-xr-x   5 ken 100   4096 May 20  2014 refs
> -rw-r--r--   1 ken 100     41 Dec  7  2010 RENAMED-REF
>
> Running git blame on a script which dates back to when the repo was
> created takes between 5 and 6 seconds to show the first screen,

Since git blame outputs everything once it is finished ("the first screen" is purely the pager's business), it needs to unpack the entire history of the file (unless no blameable lines remain at all) and look at it. 6 seconds tends not to be all that excessive for extracting more than 5 years of a file's history.

-- 
David Kastrup
Previous: Ken MoffatNext: Linus Torvalds
Message 5 of 9 in “Git very slow ?”
  1. Ken MoffatMar 7, 2015
  2. Kevin DMar 8, 2015
  3. David KastrupMar 8, 2015
  4. Ken MoffatMar 8, 2015
  5. David KastrupMar 8, 2015
  6. Linus TorvaldsMar 8, 2015
  7. Ken MoffatMar 8, 2015
  8. Linus TorvaldsMar 8, 2015
  9. Ken MoffatMar 8, 2015

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.