summaryrefslogtreecommitdiff
path: root/t/perf
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-12-16 13:08:31 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-12-16 13:08:32 -0800
commit6d831b8a3ec7dc06981e6347eb9a45849ef88665 (patch)
treefc092e735f665fb642eb9e03e5c5769bd3aa99c9 /t/perf
parentMerge branch 'js/builtin-add-i-cmds' (diff)
parentpackfile.c: speed up loading lots of packfiles (diff)
downloadtgif-6d831b8a3ec7dc06981e6347eb9a45849ef88665.tar.xz
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 a369152c47..7ee791669a 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