<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/perf, branch v2.26.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.26.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.26.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-02-14T18:46:22Z</updated>
<entry>
<title>pack-objects: support filters with bitmaps</title>
<updated>2020-02-14T18:46:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-02-14T18:22:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ab3185f999f5d0d0079ac8246edb8fca5d9d3fd'/>
<id>urn:sha1:3ab3185f999f5d0d0079ac8246edb8fca5d9d3fd</id>
<content type='text'>
Just as rev-list recently learned to combine filters and bitmaps, let's
do the same for pack-objects. The infrastructure is all there; we just
need to pass along our filter options, and the pack-bitmap code will
decide to use bitmaps or not.

This unsurprisingly makes things faster for partial clones of large
repositories (here we're cloning linux.git):

  Test                               HEAD^               HEAD
  ------------------------------------------------------------------------------
  5310.11: simulated partial clone   38.94(37.28+5.87)   11.06(11.27+4.07) -71.6%

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-bitmap: implement BLOB_LIMIT filtering</title>
<updated>2020-02-14T18:46:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-02-14T18:22:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=84243da1298890bd7370df66b754c2b252a08346'/>
<id>urn:sha1:84243da1298890bd7370df66b754c2b252a08346</id>
<content type='text'>
Just as the previous commit implemented BLOB_NONE, we can support
BLOB_LIMIT filters by looking at the sizes of any blobs in the result
and unsetting their bits as appropriate. This is slightly more expensive
than BLOB_NONE, but still produces a noticeable speedup (these results
are on git.git):

  Test                                         HEAD~2            HEAD
  ------------------------------------------------------------------------------------
  5310.9:  rev-list count with blob:none       1.80(1.77+0.02)   0.22(0.20+0.02) -87.8%
  5310.10: rev-list count with blob:limit=1k   1.99(1.96+0.03)   0.29(0.25+0.03) -85.4%

The implementation is similar to the BLOB_NONE one, with the exception
that we have to go object-by-object while walking the blob-type bitmap
(since we can't mask out the matches, but must look up the size
individually for each blob). The trick with using ctz64() is taken from
show_objects_for_type(), which likewise needs to find individual bits
(but wants to quickly skip over big chunks without blobs).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-bitmap: implement BLOB_NONE filtering</title>
<updated>2020-02-14T18:46:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-02-14T18:22:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4f3bd5606a02260274555f41fd7d6368f2bea1d8'/>
<id>urn:sha1:4f3bd5606a02260274555f41fd7d6368f2bea1d8</id>
<content type='text'>
We can easily support BLOB_NONE filters with bitmaps. Since we know the
types of all of the objects, we just need to clear the result bits of
any blobs.

Note two subtleties in the implementation (which I also called out in
comments):

  - we have to include any blobs that were specifically asked for (and
    not reached through graph traversal) to match the non-bitmap version

  - we have to handle in-pack and "ext_index" objects separately.
    Arguably prepare_bitmap_walk() could be adding these ext_index
    objects to the type bitmaps. But it doesn't for now, so let's match
    the rest of the bitmap code here (it probably wouldn't be an
    efficiency improvement to do so since the cost of extending those
    bitmaps is about the same as our loop here, but it might make the
    code a bit simpler).

Here are perf results for the new test on git.git:

  Test                                    HEAD^             HEAD
  --------------------------------------------------------------------------------
  5310.9: rev-list count with blob:none   1.67(1.62+0.05)   0.22(0.21+0.02) -86.8%

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rev-list: allow commit-only bitmap traversals</title>
<updated>2020-02-14T18:46:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-02-14T18:22:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4eb707ebd681eb85306071db33ed70186d1642ac'/>
<id>urn:sha1:4eb707ebd681eb85306071db33ed70186d1642ac</id>
<content type='text'>
Ever since we added reachability bitmap support, we've been able to use
it with rev-list to get the full list of objects, like:

  git rev-list --objects --use-bitmap-index --all

But you can't do so without --objects, since we weren't ready to just
show the commits. However, the internals of the bitmap code are mostly
ready for this: they avoid opening up trees when walking to fill in the
bitmaps. We just need to actually pass in the rev_info to
traverse_bitmap_commit_list() so it knows which types to bother
triggering our callback for.

For completeness, the perf test now covers both the existing --objects
case, as well as the new commits-only behavior (the objects one got way
faster when we introduced bitmaps, but obviously isn't improved now).

Here are numbers for linux.git:

  Test                         HEAD^               HEAD
  ------------------------------------------------------------------------
  5310.7: rev-list (commits)   8.29(8.10+0.19)       1.76(1.72+0.04) -78.8%
  5310.8: rev-list (objects)   8.06(7.94+0.12)       8.14(7.94+0.13) +1.0%

That run was cheating a little, as I didn't have any commit-graph in the
repository, and we'd built it by default these days when running git-gc.
Here are numbers with a commit-graph:

  Test                         HEAD^               HEAD
  ------------------------------------------------------------------------
  5310.7: rev-list (commits)   0.70(0.58+0.12)     0.51(0.46+0.04) -27.1%
  5310.8: rev-list (objects)   6.20(6.09+0.10)     6.27(6.16+0.11) +1.1%

Still an improvement, but a lot less impressive.

We could have the perf script remove any commit-graph to show the
out-sized effect, but it probably makes sense to leave it in what would
be a more typical setup.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cs/store-packfiles-in-hashmap'</title>
<updated>2019-12-16T21:08:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-12-16T21:08:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d831b8a3ec7dc06981e6347eb9a45849ef88665'/>
<id>urn:sha1:6d831b8a3ec7dc06981e6347eb9a45849ef88665</id>
<content type='text'>
In a repository with many packfiles, the cost of the procedure that
avoids registering the same packfile twice was unnecessarily high
by using an inefficient search algorithm, which has been corrected.

* cs/store-packfiles-in-hashmap:
  packfile.c: speed up loading lots of packfiles
</content>
</entry>
<entry>
<title>Merge branch 'jk/perf-wo-git-dot-pm'</title>
<updated>2019-12-10T21:11:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-12-10T21:11:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=55c37d12d3b105856cb8085c5d7e26bed313e863'/>
<id>urn:sha1:55c37d12d3b105856cb8085c5d7e26bed313e863</id>
<content type='text'>
Test cleanup.

* jk/perf-wo-git-dot-pm:
  t/perf: don't depend on Git.pm
</content>
</entry>
<entry>
<title>Merge branch 'tg/perf-remove-stale-result'</title>
<updated>2019-12-06T23:09:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-12-06T23:09:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7cb0d37f6dcf8b6f0e176c9080ee0e6a9ce52ab0'/>
<id>urn:sha1:7cb0d37f6dcf8b6f0e176c9080ee0e6a9ce52ab0</id>
<content type='text'>
PerfTest fix to avoid stale result mixed up with the latest round
of test results.

* tg/perf-remove-stale-result:
  perf-lib: use a single filename for all measurement types
</content>
</entry>
<entry>
<title>packfile.c: speed up loading lots of packfiles</title>
<updated>2019-12-03T15:59:45Z</updated>
<author>
<name>Colin Stolley</name>
<email>cstolley@runbox.com</email>
</author>
<published>2019-11-27T22:24:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ec48540fe8c387cf7424d5387ddbd53e89bb9d51'/>
<id>urn:sha1:ec48540fe8c387cf7424d5387ddbd53e89bb9d51</id>
<content type='text'>
When loading packfiles on start-up, we traverse the internal packfile
list once per file to avoid reloading packfiles that have already
been loaded. This check runs in quadratic time, so for poorly
maintained repos with a large number of packfiles, it can be pretty
slow.

Add a hashmap containing the packfile names as we load them so that
the average runtime cost of checking for already-loaded packs becomes
constant.

Add a perf test to p5303 to show speed-up.

The existing p5303 test runtimes are dominated by other factors and do
not show an appreciable speed-up. The new test in p5303 clearly exposes
a speed-up in bad cases. In this test we create 10,000 packfiles and
measure the start-up time of git rev-parse, which does little else
besides load in the packs.

Here are the numbers for the new p5303 test:

Test                         HEAD^             HEAD
---------------------------------------------------------------------
5303.12: load 10,000 packs   1.03(0.92+0.10)   0.12(0.02+0.09) -88.3%

Signed-off-by: Colin Stolley &lt;cstolley@runbox.com&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
[jc: squashed the change to call hashmap in install_packed_git() by peff]
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/optim-in-pack-idx-conversion'</title>
<updated>2019-12-01T17:04:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-12-01T17:04:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8faff3899e1fdefbdd143eaf5ce3b96532205bc7'/>
<id>urn:sha1:8faff3899e1fdefbdd143eaf5ce3b96532205bc7</id>
<content type='text'>
Code clean-up.

* jk/optim-in-pack-idx-conversion:
  pack-objects: avoid pointless oe_map_new_pack() calls
</content>
</entry>
<entry>
<title>t/perf: don't depend on Git.pm</title>
<updated>2019-11-27T01:53:36Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-11-25T16:47:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=528d9e6d0190b0ab8fbbab0b7b1b68f512f5dfcd'/>
<id>urn:sha1:528d9e6d0190b0ab8fbbab0b7b1b68f512f5dfcd</id>
<content type='text'>
The perf suite's aggregate.perl depends on Git.pm, which is a mild
annoyance if you've built git with NO_PERL. It turns out that the only
thing we use it for is a single call of the command_oneline() helper.
We can just replace this with backticks or similar.

Annoyingly, perl has no backtick equivalent that avoids a shell eval,
which means our $arg would require quoting. This probably doesn't matter
for our purposes, but it's better to be safe and model good style. So
we'll just provide a short helper around open(), which takes its
arguments as a list.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
