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

[PATCH 4/4] pack-bitmap-write.c: instrument number of reused bitmaps

From
Taylor Blau <me@ttaylorr.com>
Date
Oct 12, 2022, 22:01 UTC
Message-ID
<dd5ceb1ec3c01e8a2af55130718fff0b5eaf2de0.1665612094.git.me@ttaylorr.com>
In-Reply-To
<cover.1665612094.git.me@ttaylorr.com>

When debugging bitmap generation performance, it is useful to know how many bitmaps were generated from scratch, and how many were the result of permuting the bit-order of an existing bitmap.

Keep track of the latter, and emit the count as a trace2_data line to aid in debugging.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
 pack-bitmap-write.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index a213f5eddc..cfa67a510f 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -384,6 +384,8 @@ static int fill_bitmap_tree(struct bitmap *bitmap,
 	return 0;
 }
 
+static int reused_bitmaps_nr;
+
 static int fill_bitmap_commit(struct bb_commit *ent,
 			      struct commit *commit,
 			      struct prio_queue *queue,
@@ -409,8 +411,10 @@ static int fill_bitmap_commit(struct bb_commit *ent,
 			 * bitmap and add its bits to this one. No need to walk
 			 * parents or the tree for this commit.
 			 */
-			if (old && !rebuild_bitmap(mapping, old, ent->bitmap))
+			if (old && !rebuild_bitmap(mapping, old, ent->bitmap)) {
+				reused_bitmaps_nr++;
 				continue;
+			}
 		}
 
 		/*
@@ -526,6 +530,8 @@ int bitmap_writer_build(struct packing_data *to_pack)
 
 	trace2_region_leave("pack-bitmap-write", "building_bitmaps_total",
 			    the_repository);
+	trace2_data_intmax("pack-bitmap-write", the_repository,
+			   "building_bitmaps_reused", reused_bitmaps_nr);
 
 	stop_progress(&writer.progress);
 
-- 
2.38.0.16.g393fd4c6db
Previous: Taylor BlauNext: Derrick Stolee
Message 5 of 7 in “midx: trace2 regions and grab-bag patches”
  1. 0/4 midx: trace2 regions and grab-bag patchesTaylor Blau, Oct 12, 2022
  2. 1/4 midx.c: fix whitespace typoTaylor Blau, Oct 12, 2022
  3. 2/4 midx.c: consider annotated tags during bitmap selectionTaylor Blau, Oct 12, 2022
  4. 3/4 midx.c: instrument MIDX and bitmap generation with trace2 regionsTaylor Blau, Oct 12, 2022
  5. 4/4 pack-bitmap-write.c: instrument number of reused bitmapsTaylor Blau, Oct 12, 2022
  6. Derrick StoleeOct 13, 2022
  7. Junio C HamanoOct 13, 2022

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.