interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / perf / p5413-connectivity-check.sh

92 lines · 2652 bytes Raw Blame History
1#!/bin/sh
2
3test_description='performance of connectivity check modes
4
5Compare the default and incremental rev-list connectivity modes
6directly, avoiding pack transfer noise.
7
8Each repository has a flat tree of many directories with 100 files
9in each. Three axes are scaled independently: tree size, commit
10count, and files changed per commit.'
11
12. ./perf-lib.sh
13
14test_perf_fresh_repo
15
16generate="$TEST_DIRECTORY/perf/generate-repo-p5413-connectivity-check.perl"
17
18# $1=dirs $2=files_per_dir $3=commits $4=hot_dirs (optional, default=all)
19# $5=files_per_commit (optional, default=1)
20test_perf_conn () {
21 local nd="$1" nf="$2" nc="$3" hot="${4:-$1}" fpc="${5:-1}"
22 local total=$(($nd * $nf))
23 local name="repo-${nd}d-${nf}f-${nc}c-${hot}h-${fpc}fpc"
24 local label="${total} files, ${nc} commits"
25 if test "$hot" -lt "$nd"
26 then
27 label="$label (${hot} hot dirs)"
28 fi
29 if test "$fpc" -gt 1
30 then
31 label="$label (${fpc} files/commit)"
32 fi
33
34 test_expect_success PERL "setup $label" '
35 if test -d '"$name"'
36 then
37 true
38 else
39 git init '"$name"' &&
40 "$PERL_PATH" '"$generate"' '"$nd"' '"$nf"' '"$nc"' '"$hot"' '"$fpc"' |
41 git -C '"$name"' fast-import --date-format=now --quiet &&
42 (
43 cd '"$name"' &&
44 git rev-parse main~'"$nc"' >../'"${name}"'_old &&
45 git rev-parse main >../'"${name}"'_new &&
46 git update-ref refs/heads/main \
47 $(cat ../'"${name}"'_old) &&
48 git repack -ad &&
49 git config gc.auto 0
50 )
51 fi
52 '
53
54 test_perf "$label (full)" --prereq PERL '
55 cat '"${name}"'_new |
56 git -C '"$name"' rev-list --connectivity-check=full \
57 --objects --stdin --not --all --quiet \
58 --exclude-promisor-objects
59 '
60
61 test_perf "$label (incremental)" --prereq PERL '
62 cat '"${name}"'_new |
63 git -C '"$name"' rev-list --connectivity-check=incremental \
64 --objects --stdin --not --all --quiet \
65 --exclude-promisor-objects
66 '
67}
68
69# Scaling tree size (10 commits, 10 files/commit).
70test_perf_conn 50 100 10 50 10
71test_perf_conn 500 100 10 500 10
72test_perf_conn 2000 100 10 2000 10
73test_perf_conn 8000 100 10 8000 10
74
75# Scaling commit count (200K files, 10 files/commit).
76test_perf_conn 2000 100 1 2000 10
77test_perf_conn 2000 100 10 2000 10
78test_perf_conn 2000 100 100 2000 10
79test_perf_conn 2000 100 500 2000 10
80test_perf_conn 2000 100 3000 2000 10
81test_perf_conn 2000 100 5000 2000 10
82test_perf_conn 2000 100 10000 2000 10
83
84# Scaling files per commit (200K files, 10 commits).
85test_perf_conn 2000 100 10 2000 1
86test_perf_conn 2000 100 10 2000 10
87test_perf_conn 2000 100 10 2000 100
88test_perf_conn 2000 100 10 2000 500
89test_perf_conn 2000 100 10 2000 1000
90test_perf_conn 2000 100 10 2000 2000
91
92test_done