| 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='test scalar performance' |
| 4 | . ./perf-lib.sh |
| 5 | |
| 6 | test_perf_large_repo "$TRASH_DIRECTORY/to-clone" |
| 7 | |
| 8 | test_expect_success 'enable server-side partial clone' ' |
| 9 | git -C to-clone config uploadpack.allowFilter true && |
| 10 | git -C to-clone config uploadpack.allowAnySHA1InWant true && |
| 11 | git -C to-clone checkout -B test-branch |
| 12 | ' |
| 13 | |
| 14 | test_perf 'scalar clone' ' |
| 15 | rm -rf scalar-clone && |
| 16 | scalar clone "file://$(pwd)/to-clone" scalar-clone |
| 17 | ' |
| 18 | |
| 19 | test_perf 'git clone' ' |
| 20 | rm -rf git-clone && |
| 21 | git clone "file://$(pwd)/to-clone" git-clone |
| 22 | ' |
| 23 | |
| 24 | test_compare_perf () { |
| 25 | command=$1 |
| 26 | shift |
| 27 | args=$* |
| 28 | test_perf "$command $args (scalar)" " |
| 29 | $command -C scalar-clone/src $args |
| 30 | " |
| 31 | |
| 32 | test_perf "$command $args (non-scalar)" " |
| 33 | $command -C git-clone $args |
| 34 | " |
| 35 | } |
| 36 | |
| 37 | test_compare_perf git status |
| 38 | test_compare_perf test_commit --append --no-tag A |
| 39 | |
| 40 | test_done |