diff options
author | Jeff King <peff@peff.net> | 2015-04-20 15:55:00 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-04-20 13:09:40 -0700 |
commit | ee1c6c34ac64c1e10b17a50710ea7002b7e7241f (patch) | |
tree | 664c9f30518680d10a7dbdaf72a0eec754bcf714 /compat/memmem.c | |
parent | sha1_file: freshen pack objects before loose (diff) | |
download | tgif-ee1c6c34ac64c1e10b17a50710ea7002b7e7241f.tar.xz |
sha1_file: only freshen packs once per run
Since 33d4221 (write_sha1_file: freshen existing objects,
2014-10-15), we update the mtime of existing objects that we
would have written out (had they not existed). For the
common case in which many objects are packed, we may update
the mtime on a single packfile repeatedly. This can result
in a noticeable performance problem if calling utime() is
expensive (e.g., because your storage is on NFS).
We can fix this by keeping a per-pack flag that lets us
freshen only once per program invocation.
An alternative would be to keep the packed_git.mtime flag up
to date as we freshen, and freshen only once every N
seconds. In practice, it's not worth the complexity. We are
racing against prune expiration times here, which inherently
must be set to accomodate reasonable program running times
(because they really care about the time between an object
being written and it becoming referenced, and the latter is
typically the last step a program takes).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/memmem.c')
0 files changed, 0 insertions, 0 deletions