From: Taylor Blau <me@ttaylorr.com>
To: git@vger.kernel.org
Cc: peff@peff.net, derrickstolee@github.com, vdye@github.com,
gitster@pobox.com
Subject: [PATCH 4/4] pack-bitmap-write.c: instrument number of reused bitmaps
Date: Wed, 12 Oct 2022 18:01:57 -0400 [thread overview]
Message-ID: <dd5ceb1ec3c01e8a2af55130718fff0b5eaf2de0.1665612094.git.me@ttaylorr.com> (raw)
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
next prev parent reply other threads:[~2022-10-12 22:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 22:01 [PATCH 0/4] midx: trace2 regions and grab-bag patches Taylor Blau
2022-10-12 22:01 ` [PATCH 1/4] midx.c: fix whitespace typo Taylor Blau
2022-10-12 22:01 ` [PATCH 2/4] midx.c: consider annotated tags during bitmap selection Taylor Blau
2022-10-12 22:01 ` [PATCH 3/4] midx.c: instrument MIDX and bitmap generation with trace2 regions Taylor Blau
2022-10-12 22:01 ` Taylor Blau [this message]
2022-10-13 13:10 ` [PATCH 0/4] midx: trace2 regions and grab-bag patches Derrick Stolee
2022-10-13 20:35 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dd5ceb1ec3c01e8a2af55130718fff0b5eaf2de0.1665612094.git.me@ttaylorr.com \
--to=me@ttaylorr.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=vdye@github.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).