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

[PATCH] git.txt: document limitations on non-typical repos (and hints)

From
pclouds@gmail.com <pclouds@gmail.com>
Date
Oct 6, 2010, 14:23 UTC
Message-ID
<4cac8659.0541730a.0ef0.3ff9@mx.google.com>
In-Reply-To
<1286283653-22616-1-git-send-email-pclouds@gmail.com>
From: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Revised version. I dropped shallow clone because it does not really
 relate to performance.
 Documentation/git.txt |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/Documentation/git.txt b/Documentation/git.txt
index dd57bdc..129947f 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -729,6 +729,47 @@ The index is also capable of storing multiple entries (called "stages")
 for a given pathname.  These stages are used to hold the various
 unmerged version of a file when a merge is in progress.
 
+Performance concerns
+--------------------
+
+Git is written with performance in mind and it works extremely well
+with its typical repositories (i.e. source code repositories, with
+a moderate number of small text files, possibly with long history).
+Non-typical repositories (a lot of files, or very large files...)
+may experience mild performance degradation. This section describes
+how Git behaves in such repositories and how to reduce impact.
+
+For repositories with a large number of files (~50k files or more),
+but you only need a few of them present in working tree, you can use
+sparse checkout (see linkgit:git-read-tree[1], section 'Sparse
+checkout'). If you need all of them present in working tree, but you
+know in advance only a few of them may be modified, please consider
+using assume-unchanged bit (see linkgit:git-update-index[1]). This
+helps reduce the number of lstat(2) calls.
+
+Git uses lstat(2) to detect changes in working tree, one call for each
+tracked file, in what is called "index refresh". A significant number of
+lstat(2) calls may create a small delay for many commands, especially
+on systems with slow lstat(2). In some cases you can reduce the number
+of lstat(2) calls by specifying what directories you are interested
+in, so no lstat(2) outside is needed. The following commands are
+however known to do full index refresh in some cases:
+linkgit:git-commit[1], linkgit:git-status[1], linkgit:git-diff[1],
+linkgit:git-reset[1], linkgit:git-checkout[1], linkgit:git-merge[1].
+
+Some commands need entire file content in memory to process.
+Files that have size a significant portion of physical RAM may
+affect performance. You may want to avoid using the following
+commands if possible on such large files:
+
+* All checkout commands (linkgit:git-checkout[1],
+  linkgit:git-checkout-index[1], linkgit:git-read-tree[1],
+  linkgit:git-clone[1]...)
+* All diff-related commands (linkgit:git-diff[1],
+  linkgit:git-log[1] with diff, linkgit:git-show[1] on commits...)
+* All commands that need file conversion processing (see
+  linkgit:gitattributes[5])
+
 Authors
 -------
 * git's founding father is Linus Torvalds <torvalds@osdl.org>.
-- 
1.7.0.2.445.gcbdb3
Previous: Nguyễn Thái Ngọc DuyNext: Junio C Hamano
Message 6 of 8 in “git.txt: document limitations on non-typical repos (and hints)”
  1. git.txt: document limitations on non-typical repos (and hints)Nguyễn Thái Ngọc Duy, Oct 5, 2010
  2. Alex RiesenOct 5, 2010
  3. Chris PackhamOct 5, 2010
  4. Nguyen Thai Ngoc DuyOct 5, 2010
  5. git.txt: document limitations on non-typical repos (and hints)Nguyễn Thái Ngọc Duy, Oct 6, 2010
  6. git.txt: document limitations on non-typical repos (and hints)pclouds@gmail.com, Oct 6, 2010
  7. Junio C HamanoOct 6, 2010
  8. Nguyen Thai Ngoc DuyOct 7, 2010

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.