@matheusbsbs / matheus-bagliano / commits / 22bac0ea52
Fork 0

Increase packedGit{Limit,WindowSize} on 64 bit systems.

If we have a 64 bit address space we can easily afford to commit a larger amount of virtual address space to pack file access. So on these platforms we should increase the default settings of core.packedGit{Limit,WindowSize} to something that will better handle very large projects. Thanks to Andy Whitcroft for pointing out that we can safely increase these defaults on such systems. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Shawn O. Pearce committed Jan 4, 2007 at 22:28 UTC 22bac0ea528fd419cb833cab5de79a36fad91524
2 files changed +18 -8
Documentation/config.txt
+10 -6
@@ -125,9 +125,12 @@ core.packedGitWindowSize::
125 more quickly. Smaller window sizes will negatively affect
126 performance due to increased calls to the operating system's
127 memory manager, but may improve performance when accessing
128 - a large number of large pack files. Default is 32 MiB,
129 - which should be reasonable for all users/operating systems.
130 - You probably do not need to adjust this value.
128 + a large number of large pack files.
129 ++
130 +Default is 1 MiB if NO_MMAP was set at compile time, otherwise 32
131 +MiB on 32 bit platforms and 1 GiB on 64 bit platforms. This should
132 +be reasonable for all users/operating systems. You probably do
133 +not need to adjust this value.
134 +
135 Common unit suffixes of 'k', 'm', or 'g' are supported.
136
@@ -136,9 +139,10 @@ core.packedGitLimit::
139 from pack files. If Git needs to access more than this many
140 bytes at once to complete an operation it will unmap existing
141 regions to reclaim virtual address space within the process.
139 - Default is 256 MiB, which should be reasonable for all
140 - users/operating systems, except on the largest projects.
141 - You probably do not need to adjust this value.
142 ++
143 +Default is 256 MiB on 32 bit platforms and 8 GiB on 64 bit platforms.
144 +This should be reasonable for all users/operating systems, except on
145 +the largest projects. You probably do not need to adjust this value.
146 +
147 Common unit suffixes of 'k', 'm', or 'g' are supported.
148
git-compat-util.h
+8 -2
@@ -97,11 +97,17 @@ extern int git_munmap(void *start, size_t length);
97 #else /* NO_MMAP */
98
99 #include <sys/mman.h>
100 -#define DEFAULT_PACKED_GIT_WINDOW_SIZE (32 * 1024 * 1024)
100 +#define DEFAULT_PACKED_GIT_WINDOW_SIZE \
101 + (sizeof(void*) >= 8 \
102 + ? 1 * 1024 * 1024 * 1024 \
103 + : 32 * 1024 * 1024)
104
105 #endif /* NO_MMAP */
106
104 -#define DEFAULT_PACKED_GIT_LIMIT (256 * 1024 * 1024)
107 +#define DEFAULT_PACKED_GIT_LIMIT \
108 + (sizeof(void*) >= 8 \
109 + ? 8 * 1024 * 1024 * 1024 \
110 + : 256 * 1024 * 1024)
111
112 #ifdef NO_SETENV
113 #define setenv gitsetenv