summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kastrup <dak@gnu.org>2019-04-02 11:56:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-03 07:45:26 (GMT)
commitf89201494308524a92eff5995d122e8553c36508 (patch)
treed8b50bf3f6a35908053acd90eb73ebcab019b488
parentaeb582a98374c094361cba1bd756dc6307432c42 (diff)
downloadgit-f89201494308524a92eff5995d122e8553c36508.zip
git-f89201494308524a92eff5995d122e8553c36508.tar.gz
git-f89201494308524a92eff5995d122e8553c36508.tar.bz2
blame.c: don't drop origin blobs as eagerly
When a parent blob already has chunks queued up for blaming, dropping the blob at the end of one blame step will cause it to get reloaded right away, doubling the amount of I/O and unpacking when processing a linear history. Keeping such parent blobs in memory seems like a reasonable optimization that should incur additional memory pressure mostly when processing the merges from old branches. Signed-off-by: David Kastrup <dak@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--blame.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/blame.c b/blame.c
index da57233..4e9ccd0 100644
--- a/blame.c
+++ b/blame.c
@@ -1561,7 +1561,8 @@ finish:
}
for (i = 0; i < num_sg; i++) {
if (sg_origin[i]) {
- drop_origin_blob(sg_origin[i]);
+ if (!sg_origin[i]->suspects)
+ drop_origin_blob(sg_origin[i]);
blame_origin_decref(sg_origin[i]);
}
}