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>

David Kastrup committed Apr 2, 2019 at 13:56 UTC f89201494308524a92eff5995d122e8553c36508
1 file changed +2 -1
blame.c
+2 -1
@@ -1561,7 +1561,8 @@ finish:
1561 }
1562 for (i = 0; i < num_sg; i++) {
1563 if (sg_origin[i]) {
1564 - drop_origin_blob(sg_origin[i]);
1564 + if (!sg_origin[i]->suspects)
1565 + drop_origin_blob(sg_origin[i]);
1566 blame_origin_decref(sg_origin[i]);
1567 }
1568 }