diff options
author | Jeff King <peff@peff.net> | 2019-07-02 01:16:49 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-07-02 10:08:40 -0700 |
commit | b1c36cb84908a31ede05e5a16fbc584c7681cffb (patch) | |
tree | 19359ac8a73db724c996ef2690402bea5210b3b6 /contrib/thunderbird-patch-inline | |
parent | The third batch (diff) | |
download | tgif-b1c36cb84908a31ede05e5a16fbc584c7681cffb.tar.xz |
test-lib: introduce test_commit_bulk
Some tests need to create a string of commits. Doing this with
test_commit is very heavy-weight, as it needs at least one process per
commit (and in fact, uses several).
For bulk creation, we can do much better by using fast-import, but it's
often a pain to generate the input. Let's provide a helper to do so.
We'll use t5310 as a guinea pig, as it has three 10-commit loops. Here
are hyperfine results before and after:
[before]
Benchmark #1: ./t5310-pack-bitmaps.sh --root=/var/ram/git-tests
Time (mean ± σ): 2.846 s ± 0.305 s [User: 3.042 s, System: 0.919 s]
Range (min … max): 2.250 s … 3.210 s 10 runs
[after]
Benchmark #1: ./t5310-pack-bitmaps.sh --root=/var/ram/git-tests
Time (mean ± σ): 2.210 s ± 0.174 s [User: 2.570 s, System: 0.604 s]
Range (min … max): 1.999 s … 2.590 s 10 runs
So we're over 20% faster, while making the callers slightly shorter. We
added a lot more lines in test-lib-function.sh, of course, and the
helper is way more featureful than we need here. But my hope is that it
will be flexible enough to use in more places.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/thunderbird-patch-inline')
0 files changed, 0 insertions, 0 deletions