<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pack-bitmap.c, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-11-29T00:54:56Z</updated>
<entry>
<title>pack-bitmap.c: trace bitmap ignore logs when midx-bitmap is found</title>
<updated>2022-11-29T00:54:56Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2022-11-28T14:09:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c8f4357010b03db1cde5b514a481b3dbc4c34895'/>
<id>urn:sha1:c8f4357010b03db1cde5b514a481b3dbc4c34895</id>
<content type='text'>
When we find a midx bitmap, we do not bother checking for pack
bitmaps, since we can use only one. But since we will warn of unused
bitmaps via trace2, let's continue looking for pack bitmaps when
tracing is enabled.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Teng Long &lt;dyroneteng@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-bitmap.c: break out of the bitmap loop early if not tracing</title>
<updated>2022-11-29T00:54:56Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2022-11-28T14:09:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=833f4c0514fb08368066ace5260b4b80792c4ffc'/>
<id>urn:sha1:833f4c0514fb08368066ace5260b4b80792c4ffc</id>
<content type='text'>
After opening a bitmap successfully, we try opening others only
because we want to report that other bitmap files are ignored in
the trace2 log.  When trace2 is not enabled, we do not have to
do any of that.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Teng Long &lt;dyroneteng@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-bitmap.c: avoid exposing absolute paths</title>
<updated>2022-11-14T22:21:16Z</updated>
<author>
<name>Teng Long</name>
<email>dyroneteng@gmail.com</email>
</author>
<published>2022-11-10T07:10:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8ddc06631b184e6f43051f7ea8ac9bbc86817127'/>
<id>urn:sha1:8ddc06631b184e6f43051f7ea8ac9bbc86817127</id>
<content type='text'>
In "open_midx_bitmap_1()" and "open_pack_bitmap_1()", when we find that
there are multiple bitmaps, we will only open the first one and then
leave warnings about the remaining pack information, the information
will contain the absolute path of the repository, for example in a
alternates usage scenario. So let's hide this kind of potentially
sensitive information in this commit.

Found-by: XingXin &lt;moweng.xx@antgroup.com&gt;
Signed-off-by: Teng Long &lt;dyroneteng@gmail.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>pack-bitmap.c: remove unnecessary "open_pack_index()" calls</title>
<updated>2022-11-14T22:21:16Z</updated>
<author>
<name>Teng Long</name>
<email>dyroneteng@gmail.com</email>
</author>
<published>2022-11-10T07:10:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2aa84d5f3ea1966a81477ad31bee0136e39d3917'/>
<id>urn:sha1:2aa84d5f3ea1966a81477ad31bee0136e39d3917</id>
<content type='text'>
When trying to open a pack bitmap, we call open_pack_bitmap_1() in a
loop, during which it tries to open up the pack index corresponding
with each available pack.

It's likely that we'll end up relying on objects in that pack later
in the process (in which case we're doing the work of opening the
pack index optimistically), but not guaranteed.

For instance, consider a repository with a large number of small
packs, and one large pack with a bitmap. If we see that bitmap pack
last in our loop which calls open_pack_bitmap_1(), the current code
will have opened *all* pack index files in the repository. If the
request can be served out of the bitmapped pack alone, then the time
spent opening these idx files was wasted.S

Since open_pack_bitmap_1() calls is_pack_valid() later on (which in
turns calls open_pack_index() itself), we can just drop the earlier
call altogether.

Signed-off-by: Teng Long &lt;dyroneteng@gmail.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ds/bitmap-lookup-remove-tracing'</title>
<updated>2022-09-27T04:46:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-09-27T04:46:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2a7d63a2453e2c30353342a2c9385fa22a846987'/>
<id>urn:sha1:2a7d63a2453e2c30353342a2c9385fa22a846987</id>
<content type='text'>
Perf-fix.

* ds/bitmap-lookup-remove-tracing:
  pack-bitmap: remove trace2 region from hot path
</content>
</entry>
<entry>
<title>pack-bitmap: remove trace2 region from hot path</title>
<updated>2022-09-26T19:09:18Z</updated>
<author>
<name>Derrick Stolee</name>
<email>derrickstolee@github.com</email>
</author>
<published>2022-09-26T13:17:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=89a1ab8fb5766d0474ff72f176804508b0558f8a'/>
<id>urn:sha1:89a1ab8fb5766d0474ff72f176804508b0558f8a</id>
<content type='text'>
The trace2 region around the call to lazy_bitmap_for_commit() in
bitmap_for_commit() was added in 28cd730680d (pack-bitmap: prepare to
read lookup table extension, 2022-08-14). While adding trace2 regions is
typically helpful for tracking performance, this method is called
possibly thousands of times as a commit walk explores commit history
looking for a matching bitmap. When trace2 output is enabled, this
region is emitted many times and performance is throttled by that
output.

For now, remove these regions entirely.

This is a critical path, and it would be valuable to measure that the
time spent in bitmap_for_commit() does not increase when using the
commit lookup table. The best way to do that would be to use a mechanism
that sums the time spent in a region and reports a single value at the
end of the process. This technique was introduced but not merged by [1]
so maybe this example presents some justification to revisit that
approach.

[1] https://lore.kernel.org/git/pull.1099.v2.git.1640720202.gitgitgadget@gmail.com/

To help with the 'git blame' output in this region, add a comment that
warns against adding a trace2 region. Delete a test from t5310 that used
that trace output to check that this lookup optimization was activated.
To create this kind of test again in the future, the stopwatch traces
mentioned earlier could be used as a signal that we activated this code
path.

Helpedy-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-bitmap: improve grammar of "xor chain" error message</title>
<updated>2022-09-23T15:54:05Z</updated>
<author>
<name>Alex Henrie</name>
<email>alexhenrie24@gmail.com</email>
</author>
<published>2022-09-22T02:51:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=711340c797ce501c732eb2b6accee0608c62d4e9'/>
<id>urn:sha1:711340c797ce501c732eb2b6accee0608c62d4e9</id>
<content type='text'>
Signed-off-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-bitmap: prepare to read lookup table extension</title>
<updated>2022-08-26T17:13:58Z</updated>
<author>
<name>Abhradeep Chakraborty</name>
<email>chakrabortyabhradeep79@gmail.com</email>
</author>
<published>2022-08-14T16:55:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=28cd730680dd7d5c0e0971827315bf8ae32f47b7'/>
<id>urn:sha1:28cd730680dd7d5c0e0971827315bf8ae32f47b7</id>
<content type='text'>
Earlier change teaches Git to write bitmap lookup table. But Git
does not know how to parse them.

Teach Git to parse the existing bitmap lookup table. The older
versions of Git are not affected by it. Those versions ignore the
lookup table.

Mentored-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Co-Mentored-by: Kaartic Sivaraam &lt;kaartic.sivaraam@gmail.com&gt;
Signed-off-by: Abhradeep Chakraborty &lt;chakrabortyabhradeep79@gmail.com&gt;
Reviewed-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tl/pack-bitmap-error-messages'</title>
<updated>2022-07-27T16:16:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-07-27T16:16:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cc29f890329d1ddc3d204fb8623971bdeddc0dbe'/>
<id>urn:sha1:cc29f890329d1ddc3d204fb8623971bdeddc0dbe</id>
<content type='text'>
Tweak various messages that come from the pack-bitmap codepaths.

* tl/pack-bitmap-error-messages:
  pack-bitmap.c: continue looping when first MIDX bitmap is found
  pack-bitmap.c: using error() instead of silently returning -1
  pack-bitmap.c: do not ignore error when opening a bitmap file
  pack-bitmap.c: rename "idx_name" to "bitmap_name"
  pack-bitmap.c: mark more strings for translations
  pack-bitmap.c: fix formatting of error messages
</content>
</entry>
<entry>
<title>pack-bitmap.c: continue looping when first MIDX bitmap is found</title>
<updated>2022-07-18T18:20:52Z</updated>
<author>
<name>Teng Long</name>
<email>dyroneteng@gmail.com</email>
</author>
<published>2022-07-18T16:46:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5dcee7c7059307ca3a9d5c1a5c6551deb25cc3dc'/>
<id>urn:sha1:5dcee7c7059307ca3a9d5c1a5c6551deb25cc3dc</id>
<content type='text'>
In "open_midx_bitmap()", we do a loop with the MIDX(es) in repo, when
the first one has been found, then will break out by a "return"
directly.

But actually, it's better to continue the loop until we have visited
both the MIDX in our repository, as well as any alternates (along with
_their_ alternates, recursively).

The reason for this is, there may exist more than one MIDX file in
a repo. The "multi_pack_index" struct is actually designed as a singly
linked list, and if a MIDX file has been already opened successfully,
then the other MIDX files will be skipped and left with a warning
"ignoring extra bitmap file." to the output.

The discussion link of community:

  https://public-inbox.org/git/YjzCTLLDCby+kJrZ@nand.local/

Helped-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Teng Long &lt;dyroneteng@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
