blob: a8eabca2c4df834eb6daaf8d154d9d5b2a84c349 [file] [log] [blame]
Victoria Dye94fcf0e2022-11-10 19:06:01 +00001#!/bin/sh
2
3test_description="Tests performance of cache tree update operations"
4
5. ./perf-lib.sh
6
7test_perf_large_repo
8test_checkout_worktree
9
10count=100
11
12test_expect_success 'setup cache tree' '
13 git write-tree
14'
15
16test_cache_tree () {
17 test_perf "$1, $3" "
18 for i in \$(test_seq $count)
19 do
20 test-tool cache-tree $4 $2
21 done
22 "
23}
24
25test_cache_tree_update_functions () {
26 test_cache_tree 'no-op' 'control' "$1" "$2"
27 test_cache_tree 'prime_cache_tree' 'prime' "$1" "$2"
28 test_cache_tree 'cache_tree_update' 'update' "$1" "$2"
29}
30
31test_cache_tree_update_functions "clean" ""
32test_cache_tree_update_functions "invalidate 2" "--invalidate 2"
33test_cache_tree_update_functions "invalidate 50" "--invalidate 50"
34test_cache_tree_update_functions "empty" "--empty"
35
36test_done