3 test_description
='Tests multi-threaded lazy_init_name_hash'
9 test_expect_success
'verify both methods build the same hashmaps' '
10 test-tool lazy-init-name-hash --dump --single >out.single &&
11 if test-tool lazy-init-name-hash --dump --multi >out.multi
13 test_set_prereq REPO_BIG_ENOUGH_FOR_MULTI &&
14 sort <out.single >sorted.single &&
15 sort <out.multi >sorted.multi &&
16 test_cmp sorted.single sorted.multi
20 test_expect_success
'calibrate' '
21 entries=$(wc -l <out.single) &&
35 1) entries_desc="1 entry" ;;
36 *) entries_desc="$entries entries" ;;
40 1) count_desc="1 round" ;;
41 *) count_desc="$count rounds" ;;
44 desc="$entries_desc, $count_desc" &&
48 test_perf
"single-threaded, $desc" "
49 test-tool lazy-init-name-hash --single --count=$count
52 test_perf REPO_BIG_ENOUGH_FOR_MULTI
"multi-threaded, $desc" "
53 test-tool lazy-init-name-hash --multi --count=$count