Skip to content

Commit

Permalink
blame.c: don't drop origin blobs as eagerly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dakhubgit authored and gitster committed Apr 3, 2019
1 parent aeb582a commit f892014
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
Expand Down

0 comments on commit f892014

Please sign in to comment.