@matheusbsbs / matheus-bagliano / commits / 47274251a4
Fork 0

p5302: disable thread-count parameter tests by default

The primary function of the perf suite is to detect regressions (or improvements) between versions of Git. The only numbers we show a direct comparison for are timings between the same test run on two different versions. However, it can sometimes be used to collect other information. For instance, p5302 runs the same index-pack operation with different thread counts. The output doesn't directly compare these, but anybody interested in working on index-pack can manually compare the results. For a normal regression run of the full perf-suite, though, this incurs a significant cost to generate numbers nobody will actually look at; about 25% of the total time of the test suite is spent in p5302. And the low-thread-count runs are the most expensive part of it, since they're (unsurprisingly) not using as many threads. Let's skip these tests by default, but make it possible for people working on index-pack to still run them by setting an environment variable. Rather than make this specific to p5302, let's introduce a generic mechanism. This makes it possible to run the full suite with every possible test if somebody really wants to burn some CPU. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Aug 21, 2020 at 13:53 UTC 47274251a4fa15846644f3a3cb9f2fae1fcea644
3 files changed +16 -5
t/perf/README
+9
@@ -84,6 +84,15 @@ You can set the following variables (also in your config.mak):
84 probably be about linux.git size for optimal results.
85 Both default to the git.git you are running from.
86
87 + GIT_PERF_EXTRA
88 + Boolean to enable additional tests. Most test scripts are
89 + written to detect regressions between two versions of Git, and
90 + the output will compare timings for individual tests between
91 + those versions. Some scripts have additional tests which are not
92 + run by default, that show patterns within a single version of
93 + Git (e.g., performance of index-pack as the number of threads
94 + changes). These can be enabled with GIT_PERF_EXTRA.
95 +
96 You can also pass the options taken by ordinary git tests; the most
97 useful one is:
98
t/perf/p5302-pack-index.sh
+5 -5
@@ -13,31 +13,31 @@ test_expect_success 'repack' '
13 export PACK
14 '
15
16 -test_perf 'index-pack 0 threads' '
16 +test_perf PERF_EXTRA 'index-pack 0 threads' '
17 rm -rf repo.git &&
18 git init --bare repo.git &&
19 GIT_DIR=repo.git git index-pack --threads=1 --stdin < $PACK
20 '
21
22 -test_perf 'index-pack 1 thread ' '
22 +test_perf PERF_EXTRA 'index-pack 1 thread ' '
23 rm -rf repo.git &&
24 git init --bare repo.git &&
25 GIT_DIR=repo.git GIT_FORCE_THREADS=1 git index-pack --threads=1 --stdin < $PACK
26 '
27
28 -test_perf 'index-pack 2 threads' '
28 +test_perf PERF_EXTRA 'index-pack 2 threads' '
29 rm -rf repo.git &&
30 git init --bare repo.git &&
31 GIT_DIR=repo.git git index-pack --threads=2 --stdin < $PACK
32 '
33
34 -test_perf 'index-pack 4 threads' '
34 +test_perf PERF_EXTRA 'index-pack 4 threads' '
35 rm -rf repo.git &&
36 git init --bare repo.git &&
37 GIT_DIR=repo.git git index-pack --threads=4 --stdin < $PACK
38 '
39
40 -test_perf 'index-pack 8 threads' '
40 +test_perf PERF_EXTRA 'index-pack 8 threads' '
41 rm -rf repo.git &&
42 git init --bare repo.git &&
43 GIT_DIR=repo.git git index-pack --threads=8 --stdin < $PACK
t/perf/perf-lib.sh
+2
@@ -245,3 +245,5 @@ test_at_end_hook_ () {
245 test_export () {
246 export "$@"
247 }
248 +
249 +test_lazy_prereq PERF_EXTRA 'test_bool_env GIT_PERF_EXTRA false'