Skip to content

Commit 003f615

Browse files
jeffhostetlerdscho
authored andcommitted
name-hash: add perf test for lazy_init_name_hash
Created t/perf/p0004-lazy-init-name-hash.sh test to demonstrate correctness and performance gains with the multithreaded version of lazy_init_name_hash(). Signed-off-by: Jeff Hostetler <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c55c60f commit 003f615

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

t/perf/p0004-lazy-init-name-hash.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
test_description='Tests multi-threaded lazy_init_name_hash'
4+
. ./perf-lib.sh
5+
6+
test_perf_large_repo
7+
test_checkout_worktree
8+
9+
test_expect_success 'verify both methods build the same hashmaps' '
10+
$GIT_BUILD_DIR/t/helper/test-lazy-init-name-hash$X --dump --single | sort >out.single &&
11+
$GIT_BUILD_DIR/t/helper/test-lazy-init-name-hash$X --dump --multi | sort >out.multi &&
12+
test_cmp out.single out.multi
13+
'
14+
15+
test_expect_success 'multithreaded should be faster' '
16+
$GIT_BUILD_DIR/t/helper/test-lazy-init-name-hash$X --perf >out.perf
17+
'
18+
19+
test_done

0 commit comments

Comments
 (0)