author | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 2 Mar 2011 18:01:54 +0000 (10:01 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 2 Mar 2011 19:25:30 +0000 (11:25 -0800) | ||
commit | d131b7afea58f47721dafd013ab6aff4adfc42dd | |
tree | eba3c5c258ff6408d15170e03cf005ff40bceed8 | tree | snapshot |
parent | 38abd9b8b4e11aa0b4cdaa5c7b44e0c0ad06820b | commit | diff |
sha1_file.c: Don't retain open fds on small packs
If a pack file is small enough that its entire contents fits within
one mmap window, mmap the file and then immediately close its file
descriptor. This reduces the number of file descriptors that are
needed to read from repositories with many tiny pack files, such
as one that has received 1000 pushes (and created 1000 small pack
files) since its last repack.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
If a pack file is small enough that its entire contents fits within
one mmap window, mmap the file and then immediately close its file
descriptor. This reduces the number of file descriptors that are
needed to read from repositories with many tiny pack files, such
as one that has received 1000 pushes (and created 1000 small pack
files) since its last repack.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | diff | blob | history | |
fast-import.c | diff | blob | history | |
sha1_file.c | diff | blob | history |