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

Re: Git very slow ?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 8, 2015, 19:46 UTC
Message-ID
<CA+55aFzDRg4kHHGGHd91kVxfj8eX0g1w5T7SyN_CouCf=_tW3A@mail.gmail.com>
In-Reply-To
<87sidfmgag.fsf@fencepost.gnu.org>
On Sun, Mar 8, 2015 at 12:37 PM, David Kastrup <dak@gnu.org> wrote:
Show 6 quoted lines
>
> 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.
Yeah, "git blame" can easily be several seconds without anything being wrong.
But "git commit" should be fairly instantaneous. Even over NFS.
That said, on NFS in particular, make sure you don't have
    [core]
        PreloadIndex = false
in your .gitconfig to disable the threaded index preloading.

But "core.preloadindex" _should_ be enabled by default in anything but the most ancient git versions, and it can make a huge difference on NFS because it allows the 'lstat()' calls to check that the index is up-to-date to be done in parallel. Without that, git on NFS can be a bit sluggish.

On local filesystems it normally doesn't make as much of a difference, since things tend to be either cached or seek-limited.

                             Linus
Previous: David KastrupNext: Ken Moffat
Message 6 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.