Victoria Dye | 94fcf0e | 2022-11-10 19:06:01 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description="Tests performance of cache tree update operations" |
| 4 | |
| 5 | . ./perf-lib.sh |
| 6 | |
| 7 | test_perf_large_repo |
| 8 | test_checkout_worktree |
| 9 | |
| 10 | count=100 |
| 11 | |
| 12 | test_expect_success 'setup cache tree' ' |
| 13 | git write-tree |
| 14 | ' |
| 15 | |
| 16 | test_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 | |
| 25 | test_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 | |
| 31 | test_cache_tree_update_functions "clean" "" |
| 32 | test_cache_tree_update_functions "invalidate 2" "--invalidate 2" |
| 33 | test_cache_tree_update_functions "invalidate 50" "--invalidate 50" |
| 34 | test_cache_tree_update_functions "empty" "--empty" |
| 35 | |
| 36 | test_done |