summaryrefslogtreecommitdiff
path: root/t/perf
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-12-16 21:08:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-16 21:08:32 (GMT)
commit6d831b8a3ec7dc06981e6347eb9a45849ef88665 (patch)
treefc092e735f665fb642eb9e03e5c5769bd3aa99c9 /t/perf
parent3beff388b2accbc474383d38ef12d4fe31152abc (diff)
parentec48540fe8c387cf7424d5387ddbd53e89bb9d51 (diff)
downloadgit-6d831b8a3ec7dc06981e6347eb9a45849ef88665.zip
git-6d831b8a3ec7dc06981e6347eb9a45849ef88665.tar.gz
git-6d831b8a3ec7dc06981e6347eb9a45849ef88665.tar.bz2
Merge branch 'cs/store-packfiles-in-hashmap'
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
Diffstat (limited to 't/perf')
-rwxr-xr-xt/perf/p5303-many-packs.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/perf/p5303-many-packs.sh b/t/perf/p5303-many-packs.sh
index a369152..7ee7916 100755
--- a/t/perf/p5303-many-packs.sh
+++ b/t/perf/p5303-many-packs.sh
@@ -85,4 +85,22 @@ do
'
done
+# Measure pack loading with 10,000 packs.
+test_expect_success 'generate lots of packs' '
+ for i in $(test_seq 10000); do
+ echo "blob"
+ echo "data <<EOF"
+ echo "blob $i"
+ echo "EOF"
+ echo "checkpoint"
+ done |
+ git -c fastimport.unpackLimit=0 fast-import
+'
+
+# The purpose of this test is to evaluate load time for a large number
+# of packs while doing as little other work as possible.
+test_perf "load 10,000 packs" '
+ git rev-parse --verify "HEAD^{commit}"
+'
+
test_done