diff options
Diffstat (limited to 't/perf')
-rw-r--r-- | t/perf/Makefile | 5 | ||||
-rw-r--r-- | t/perf/README | 2 | ||||
-rwxr-xr-x | t/perf/p3400-rebase.sh | 6 | ||||
-rwxr-xr-x | t/perf/p7519-fsmonitor.sh | 96 |
4 files changed, 64 insertions, 45 deletions
diff --git a/t/perf/Makefile b/t/perf/Makefile index 8c47155a7c..fcb0e8865e 100644 --- a/t/perf/Makefile +++ b/t/perf/Makefile @@ -1,7 +1,7 @@ -include ../../config.mak export GIT_TEST_OPTIONS -all: perf +all: test-lint perf perf: pre-clean ./run @@ -12,4 +12,7 @@ pre-clean: clean: rm -rf build "trash directory".* test-results +test-lint: + $(MAKE) -C .. test-lint + .PHONY: all perf pre-clean clean diff --git a/t/perf/README b/t/perf/README index bd649afa97..fb9127a66f 100644 --- a/t/perf/README +++ b/t/perf/README @@ -28,6 +28,8 @@ the tests on the current git repository. 7810.3: grep --cached, cheap regex 3.07(3.02+0.25) 7810.4: grep --cached, expensive regex 9.39(30.57+0.24) +Output format is in seconds "Elapsed(User + System)" + You can compare multiple repositories and even git revisions with the 'run' script: diff --git a/t/perf/p3400-rebase.sh b/t/perf/p3400-rebase.sh index d202aaed06..7a0bb29448 100755 --- a/t/perf/p3400-rebase.sh +++ b/t/perf/p3400-rebase.sh @@ -9,16 +9,16 @@ test_expect_success 'setup rebasing on top of a lot of changes' ' git checkout -f -B base && git checkout -B to-rebase && git checkout -B upstream && - for i in $(seq 100) + for i in $(test_seq 100) do # simulate huge diffs echo change$i >unrelated-file$i && - seq 1000 >>unrelated-file$i && + test_seq 1000 >>unrelated-file$i && git add unrelated-file$i && test_tick && git commit -m commit$i unrelated-file$i && echo change$i >unrelated-file$i && - seq 1000 | tac >>unrelated-file$i && + test_seq 1000 | tac >>unrelated-file$i && git add unrelated-file$i && test_tick && git commit -m commit$i-reverse unrelated-file$i || diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh index def7ecdbc7..fb20fe0937 100755 --- a/t/perf/p7519-fsmonitor.sh +++ b/t/perf/p7519-fsmonitor.sh @@ -114,63 +114,77 @@ test_expect_success "setup for fsmonitor" ' fi && git config core.fsmonitor "$INTEGRATION_SCRIPT" && - git update-index --fsmonitor + git update-index --fsmonitor && + mkdir 1_file 10_files 100_files 1000_files 10000_files && + for i in $(test_seq 1 10); do touch 10_files/$i; done && + for i in $(test_seq 1 100); do touch 100_files/$i; done && + for i in $(test_seq 1 1000); do touch 1000_files/$i; done && + for i in $(test_seq 1 10000); do touch 10000_files/$i; done && + git add 1_file 10_files 100_files 1000_files 10000_files && + git commit -m "Add files" && + git status # Warm caches ' -if test -n "$GIT_PERF_7519_DROP_CACHE"; then - test-tool drop-caches -fi +test_perf_w_drop_caches () { + if test -n "$GIT_PERF_7519_DROP_CACHE"; then + test-tool drop-caches + fi -test_perf "status (fsmonitor=$INTEGRATION_SCRIPT)" ' - git status -' + test_perf "$@" +} -if test -n "$GIT_PERF_7519_DROP_CACHE"; then - test-tool drop-caches -fi +test_fsmonitor_suite() { + test_perf_w_drop_caches "status (fsmonitor=$INTEGRATION_SCRIPT)" ' + git status + ' -test_perf "status -uno (fsmonitor=$INTEGRATION_SCRIPT)" ' - git status -uno -' + test_perf_w_drop_caches "status -uno (fsmonitor=$INTEGRATION_SCRIPT)" ' + git status -uno + ' -if test -n "$GIT_PERF_7519_DROP_CACHE"; then - test-tool drop-caches -fi + test_perf_w_drop_caches "status -uall (fsmonitor=$INTEGRATION_SCRIPT)" ' + git status -uall + ' -test_perf "status -uall (fsmonitor=$INTEGRATION_SCRIPT)" ' - git status -uall -' + test_perf_w_drop_caches "diff (fsmonitor=$INTEGRATION_SCRIPT)" ' + git diff + ' -test_expect_success "setup without fsmonitor" ' - unset INTEGRATION_SCRIPT && - git config --unset core.fsmonitor && - git update-index --no-fsmonitor -' + test_perf_w_drop_caches "diff -- 0_files (fsmonitor=$INTEGRATION_SCRIPT)" ' + git diff -- 1_file + ' -if test -n "$GIT_PERF_7519_DROP_CACHE"; then - test-tool drop-caches -fi + test_perf_w_drop_caches "diff -- 10_files (fsmonitor=$INTEGRATION_SCRIPT)" ' + git diff -- 10_files + ' -test_perf "status (fsmonitor=$INTEGRATION_SCRIPT)" ' - git status -' + test_perf_w_drop_caches "diff -- 100_files (fsmonitor=$INTEGRATION_SCRIPT)" ' + git diff -- 100_files + ' -if test -n "$GIT_PERF_7519_DROP_CACHE"; then - test-tool drop-caches -fi + test_perf_w_drop_caches "diff -- 1000_files (fsmonitor=$INTEGRATION_SCRIPT)" ' + git diff -- 1000_files + ' -test_perf "status -uno (fsmonitor=$INTEGRATION_SCRIPT)" ' - git status -uno -' + test_perf_w_drop_caches "diff -- 10000_files (fsmonitor=$INTEGRATION_SCRIPT)" ' + git diff -- 10000_files + ' -if test -n "$GIT_PERF_7519_DROP_CACHE"; then - test-tool drop-caches -fi + test_perf_w_drop_caches "add (fsmonitor=$INTEGRATION_SCRIPT)" ' + git add --all + ' +} + +test_fsmonitor_suite -test_perf "status -uall (fsmonitor=$INTEGRATION_SCRIPT)" ' - git status -uall +test_expect_success "setup without fsmonitor" ' + unset INTEGRATION_SCRIPT && + git config --unset core.fsmonitor && + git update-index --no-fsmonitor ' +test_fsmonitor_suite + if test_have_prereq WATCHMAN then watchman watch-del "$GIT_WORK_TREE" >/dev/null 2>&1 && |