1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-28 19:46:14 +02:00

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>
This commit is contained in:
David Kastrup 2019-04-02 13:56:25 +02:00 committed by Junio C Hamano
parent aeb582a983
commit f892014943

View File

@ -1561,7 +1561,8 @@ static void pass_blame(struct blame_scoreboard *sb, struct blame_origin *origin,
}
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]);
}
}