git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] blame.c: don't drop origin blobs as eagerly

From
David Kastrup <dak@gnu.org>
Date
Apr 2, 2019, 11:56 UTC
Message-ID
<20190402115625.21427-1-dak@gnu.org>

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>
---
 blame.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/blame.c b/blame.c
index 5c07dec190..c11c516921 100644
--- a/blame.c
+++ b/blame.c
@@ -1562,7 +1562,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]);
 		}
 	}
-- 
2.20.1
Next: Junio C Hamano
Message 1 of 8 in “blame.c: don't drop origin blobs as eagerly”
  1. blame.c: don't drop origin blobs as eagerlyDavid Kastrup, Apr 2, 2019
  2. Junio C HamanoApr 3, 2019
  3. Duy NguyenApr 3, 2019
  4. Jeff KingApr 3, 2019
  5. Duy NguyenApr 3, 2019
  6. Jeff KingApr 3, 2019
  7. David KastrupApr 3, 2019
  8. David KastrupApr 3, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.