Skip to content

Commit f892014

Browse files
dakhubgitgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aeb582a commit f892014

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

blame.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,8 @@ static void pass_blame(struct blame_scoreboard *sb, struct blame_origin *origin,
15611561
}
15621562
for (i = 0; i < num_sg; i++) {
15631563
if (sg_origin[i]) {
1564-
drop_origin_blob(sg_origin[i]);
1564+
if (!sg_origin[i]->suspects)
1565+
drop_origin_blob(sg_origin[i]);
15651566
blame_origin_decref(sg_origin[i]);
15661567
}
15671568
}

0 commit comments

Comments
 (0)