summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-12-24 05:46:13 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-12-29 19:36:45 (GMT)
commit8c82534d89cef9260c12768e74eb4ef6c54f7217 (patch)
treeeb95cd05ad68277e028a2c4e542e639b4dd4feaf /git-compat-util.h
parent2dee8af67688bb24575dd6b07106bc41d9997923 (diff)
downloadgit-8c82534d89cef9260c12768e74eb4ef6c54f7217.zip
git-8c82534d89cef9260c12768e74eb4ef6c54f7217.tar.gz
git-8c82534d89cef9260c12768e74eb4ef6c54f7217.tar.bz2
Default core.packdGitWindowSize to 1 MiB if NO_MMAP.
If the compiler has asked us to disable use of mmap() on their platform then we are forced to use git_mmap and its emulation via pread. In this case large (e.g. 32 MiB) windows for pack access are simply too big as a command will wind up reading a lot more data than it will ever need, significantly reducing response time. To prevent a high latency when NO_MMAP has been selected we now use a default of 1 MiB for core.packedGitWindowSize. Credit goes to Linus and Junio for recommending this more reasonable setting. [jc: upcased the name of the symbolic constant, and made another hardcoded constant into a symbolic constant while at it. ] Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 5d9eb26..4764087 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -92,12 +92,17 @@ extern void set_warn_routine(void (*routine)(const char *warn, va_list params));
extern void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
extern int git_munmap(void *start, size_t length);
+#define DEFAULT_PACKED_GIT_WINDOW_SIZE (1 * 1024 * 1024)
+
#else /* NO_MMAP */
#include <sys/mman.h>
+#define DEFAULT_PACKED_GIT_WINDOW_SIZE (32 * 1024 * 1024)
#endif /* NO_MMAP */
+#define DEFAULT_PACKED_GIT_LIMIT (256 * 1024 * 1024)
+
#ifdef NO_SETENV
#define setenv gitsetenv
extern int gitsetenv(const char *, const char *, int);